Skip to content
TypeScript

fix(web): keep settings inputs focused during IME composition (#10262)

Simone9c96ac25804d
diff --git a/apps/web/src/hooks/useCommitOnBlur.ts b/apps/web/src/hooks/useCommitOnBlur.ts
index d1154fbb265..868b727cb40 100644
--- a/apps/web/src/hooks/useCommitOnBlur.ts
+++ b/apps/web/src/hooks/useCommitOnBlur.ts
@@ -34,6 +34,7 @@ export function useCommitOnBlur(value: string, onCommit: (next: string) => void)
}
},
onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => {
+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
if (event.key === "Enter") {
event.preventDefault();
(event.target as HTMLInputElement).blur();