From 7e5bc7b7ae617102ab86bd7092070a1c8b4695a5 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Fri, 30 Jan 2026 22:42:54 +0800 Subject: [PATCH] fix(ui): prevent chat submit during IME composition Check e.nativeEvent.isComposing so pressing Enter to confirm CJK input does not accidentally submit the message. Co-Authored-By: Claude Opus 4.5 --- packages/ui/src/components/chat-input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/components/chat-input.tsx b/packages/ui/src/components/chat-input.tsx index 16c25cc9..9c9a2b05 100644 --- a/packages/ui/src/components/chat-input.tsx +++ b/packages/ui/src/components/chat-input.tsx @@ -33,7 +33,7 @@ export function ChatInput({ onSubmit, disabled }: ChatInputProps) { e.target.style.height = `${Math.min(e.target.scrollHeight, 200)}px`; }} onKeyDown={(e) => { - if (e.key === "Enter" && !e.shiftKey) { + if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault(); handleSubmit(); }