From b0dd02b92e107267e54034bc65dfb03266da5d31 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Wed, 4 Jun 2025 18:04:35 +0900 Subject: [PATCH] fix: improve IME compatibility by changing form submission to Ctrl/Cmd+Enter - Remove automatic form submission on Enter key to prevent conflicts with IME - Add Ctrl+Enter (Windows/Linux) and Cmd+Enter (Mac) as submission shortcuts - Preserve native textarea behavior for line breaks with Shift+Enter - Fix issue where Japanese/Chinese/Korean input confirmation triggered form submission --- frontend/src/components/InputForm.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/InputForm.tsx b/frontend/src/components/InputForm.tsx index 6f3127c..70c658f 100644 --- a/frontend/src/components/InputForm.tsx +++ b/frontend/src/components/InputForm.tsx @@ -35,10 +35,9 @@ export const InputForm: React.FC = ({ setInternalInputValue(""); }; - const handleInternalKeyDown = ( - e: React.KeyboardEvent - ) => { - if (e.key === "Enter" && !e.shiftKey) { + const handleKeyDown = (e: React.KeyboardEvent) => { + // Submit with Ctrl+Enter (Windows/Linux) or Cmd+Enter (Mac) + if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { e.preventDefault(); handleInternalSubmit(); } @@ -59,9 +58,9 @@ export const InputForm: React.FC = ({