1export function isIMEComposing(event: KeyboardEvent) {
2 // Check for IME composition using isComposing property and keyCode 229 (specifically for IME composition on Safari, which is notorious for not supporting KeyboardEvent.isComposing)
3 // This prevents form submission when confirming IME word selection (e.g., Japanese/Chinese input)
4 return event.isComposing || event.keyCode === 229;
5}