From 567b4a0411173f7ddf2feb8fe6cd784701249c0a Mon Sep 17 00:00:00 2001 From: hayato iida Date: Sat, 4 Oct 2025 22:30:46 +0900 Subject: [PATCH] Fix: Prevent form submission during IME composition (#934) This fix addresses issue #919 where pressing Enter during IME (Input Method Editor) composition incorrectly triggers form submission in task title and description fields. Changes: - Add isComposing check to Input component's Enter key handler - Add isComposing check to AutoExpandingTextarea component's Enter key handler This ensures that Enter key during IME composition (e.g., Japanese, Chinese, Korean input) only confirms the text conversion without accidentally submitting the form. Fixes #919 --- frontend/src/components/ui/auto-expanding-textarea.tsx | 2 +- frontend/src/components/ui/input.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/ui/auto-expanding-textarea.tsx b/frontend/src/components/ui/auto-expanding-textarea.tsx index 85be1ca4..71ec2160 100644 --- a/frontend/src/components/ui/auto-expanding-textarea.tsx +++ b/frontend/src/components/ui/auto-expanding-textarea.tsx @@ -50,7 +50,7 @@ const AutoExpandingTextarea = React.forwardRef< // Handle keyboard shortcuts const handleKeyDown = React.useCallback( (e: React.KeyboardEvent) => { - if (e.key === 'Enter') { + if (e.key === 'Enter' && !e.nativeEvent.isComposing) { if (e.metaKey && e.shiftKey) { onCommandShiftEnter?.(e); } else if (e.metaKey) { diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx index 342f39da..9e5a3e40 100644 --- a/frontend/src/components/ui/input.tsx +++ b/frontend/src/components/ui/input.tsx @@ -23,7 +23,7 @@ const Input = React.forwardRef( if (e.key === 'Escape') { e.currentTarget.blur(); } - if (e.key === 'Enter') { + if (e.key === 'Enter' && !e.nativeEvent.isComposing) { if (e.metaKey && e.shiftKey) { onCommandShiftEnter?.(e); } else {