Prevent premature submission on IME input (#16673)
* fix: Prevent premature submission on IME input * chore: update webui static build * refactor: Put IME completion checker in a helper function and add checking for `KeyboardEvent.eventKey === 229` * chore: update webui static build * chore: update webui static build * chore: update webui static build
This commit is contained in:
committed by
GitHub
parent
0e4a0cf2fa
commit
79068501fa
@@ -0,0 +1,5 @@
|
||||
export function isIMEComposing(event: KeyboardEvent) {
|
||||
// Check for IME composition using isComposing property and keyCode 229 (specifically for IME composition on Safari, which is notorious for not supporting KeyboardEvent.isComposing)
|
||||
// This prevents form submission when confirming IME word selection (e.g., Japanese/Chinese input)
|
||||
return event.isComposing || event.keyCode === 229;
|
||||
}
|
||||
Reference in New Issue
Block a user