mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-23 08:25:57 +00:00
fix(frontend): prevent submit during IME composition (#1562)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user