From 9b8fb62790165786b15929019aa17a5063f68ec3 Mon Sep 17 00:00:00 2001 From: B0sh Date: Sat, 9 Aug 2025 11:17:02 -0500 Subject: [PATCH] fix: Prevent accidental message submitting on ChatInput for users with IME input languages --- web-app/src/containers/ChatInput.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx index a2f4bb013c..5268834b2a 100644 --- a/web-app/src/containers/ChatInput.tsx +++ b/web-app/src/containers/ChatInput.tsx @@ -371,7 +371,9 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => { setRows(Math.min(newRows, maxRows)) }} onKeyDown={(e) => { - if (e.key === 'Enter' && !e.shiftKey && prompt.trim()) { + // e.keyCode 229 is for IME input with Safari + const isComposing = e.nativeEvent.isComposing || e.keyCode === 229; + if (e.key === 'Enter' && !e.shiftKey && prompt.trim() && !isComposing) { e.preventDefault() // Submit the message when Enter is pressed without Shift handleSendMesage(prompt)