diff --git a/packages/workshop-frontend/src/ChatInterface.tsx b/packages/workshop-frontend/src/ChatInterface.tsx index d5dac25a..1f14ec99 100644 --- a/packages/workshop-frontend/src/ChatInterface.tsx +++ b/packages/workshop-frontend/src/ChatInterface.tsx @@ -3146,6 +3146,10 @@ export const ChatInput = ({ } }} onKeyDown={(e) => { + // While an IME composition is active (e.g. Japanese input), Enter confirms + // the conversion and must not send the message. keyCode 229 covers browsers + // that fire the confirming keydown without isComposing set (e.g. Safari). + if (e.nativeEvent.isComposing || e.keyCode === 229) return; if (slashCommandPicker.open && e.key === "Escape") { e.preventDefault(); slashCommandPicker.dismiss(); @@ -6511,6 +6515,7 @@ function ChatInterface({ onChange={(e) => setRenamingInput(e.target.value)} onClick={(e) => e.stopPropagation()} onKeyDown={(e) => { + if (e.nativeEvent.isComposing || e.keyCode === 229) return; if (e.key === "Enter") { e.preventDefault(); handleSaveListRename(chat.id); @@ -6730,6 +6735,7 @@ function ChatInterface({ value={titleInput} onChange={(e) => setTitleInput(e.target.value)} onKeyDown={(e) => { + if (e.nativeEvent.isComposing || e.keyCode === 229) return; if (e.key === "Enter") handleSaveChatTitle(); if (e.key === "Escape") handleCancelTitleEdit(); }}