diff --git a/ui/src/components/ConversationDrawer.tsx b/ui/src/components/ConversationDrawer.tsx index 9165cd687f272e9ce2e6e5a8a49968e8c2426727..d0e84eabc7a54d7820757a436522018ed08f061a 100644 --- a/ui/src/components/ConversationDrawer.tsx +++ b/ui/src/components/ConversationDrawer.tsx @@ -172,6 +172,10 @@ function ConversationDrawer({ }; const handleRenameKeyDown = (e: React.KeyboardEvent, conversationId: string) => { + // Don't submit while IME is composing (e.g., converting Japanese hiragana to kanji) + if (e.nativeEvent.isComposing) { + return; + } if (e.key === "Enter") { e.preventDefault(); handleRename(conversationId); diff --git a/ui/src/components/DirectoryPickerModal.tsx b/ui/src/components/DirectoryPickerModal.tsx index e5ab16ebd71e398bcb4cda66326d601ed3646011..966c762e66e05fb9e9868d44bcd76fea2ea0e897 100644 --- a/ui/src/components/DirectoryPickerModal.tsx +++ b/ui/src/components/DirectoryPickerModal.tsx @@ -172,6 +172,10 @@ function DirectoryPickerModal({ }; const handleInputKeyDown = (e: React.KeyboardEvent) => { + // Don't submit while IME is composing (e.g., converting Japanese hiragana to kanji) + if (e.nativeEvent.isComposing) { + return; + } if (e.key === "Enter") { e.preventDefault(); handleSelect(); diff --git a/ui/src/components/MessageInput.tsx b/ui/src/components/MessageInput.tsx index f0e5b750c58d4ac0942e36463b0617ec0535a63e..41209d9ea7e9cf163c5b87dc5fe9783c4fed663f 100644 --- a/ui/src/components/MessageInput.tsx +++ b/ui/src/components/MessageInput.tsx @@ -304,6 +304,10 @@ function MessageInput({ }; const handleKeyDown = (e: React.KeyboardEvent) => { + // Don't submit while IME is composing (e.g., converting Japanese hiragana to kanji) + if (e.nativeEvent.isComposing) { + return; + } if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); handleSubmit(e);