дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
WebKit sends the Enter (or Space) that commits a candidate after compositionend, with isComposing already false and keyCode 229. Handlers that checked isComposing alone ran it: dialogs confirmed and shortcuts fired while typing Chinese or Japanese. isImeKey() checks both, and every keydown handler that skipped composition uses it.
9 рядки
380 B
TypeScript
9 рядки
380 B
TypeScript
/**
|
|
* True while an input method is composing, including the key that ends it: WebKit sends the
|
|
* Enter / Space that commits a candidate after `compositionend`, with `isComposing` already
|
|
* false and keyCode 229, so a handler checking `isComposing` alone runs that Enter.
|
|
*/
|
|
export function isImeKey(e: KeyboardEvent): boolean {
|
|
return e.isComposing || e.keyCode === 229;
|
|
}
|