fix(frontend): prevent submit during IME composition (#1562)

This commit is contained in:
Sleepy Ranx 🌙
2026-03-29 22:36:38 +08:00
committed by GitHub
parent d475de7997
commit 866cf4ef73
4 changed files with 17 additions and 3 deletions
+10
View File
@@ -0,0 +1,10 @@
import type { KeyboardEvent } from "react";
type IMEKeyboardEvent = KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>;
export function isIMEComposing(
event: IMEKeyboardEvent,
isComposing = false,
): boolean {
return isComposing || event.nativeEvent.isComposing || event.keyCode === 229;
}