Fix inline rename during IME composition (#519)

This commit is contained in:
Su
2026-08-01 07:45:36 -07:00
committed by GitHub
parent cef6abf5d0
commit 3503a9da8e
3 changed files with 30 additions and 0 deletions
@@ -0,0 +1,7 @@
export type ImeKeyboardEvent = Pick<KeyboardEvent, "isComposing" | "keyCode">;
export function isImeCompositionEvent(event: ImeKeyboardEvent): boolean {
// Safari can clear `isComposing` on the keydown that finishes composition.
// `229` is retained as the compatibility signal that an IME is processing it.
return event.isComposing || event.keyCode === 229;
}