From 33447233933f34ba9481bb470c255eadc2474e7e Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Mon, 13 Oct 2025 13:09:52 +0800 Subject: [PATCH] fix: prevent Enter key from triggering submit during IME composition Add isComposing check at the start of handleKeyDown to ignore keyboard events during IME (Chinese/Japanese/Korean) input composition. This follows the existing pattern used in tag-management component and prevents premature form submission when users press Enter to confirm IME candidates. --- web/app/components/workflow/comment/mention-input.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/app/components/workflow/comment/mention-input.tsx b/web/app/components/workflow/comment/mention-input.tsx index 656d8abe20..18810e9ad1 100644 --- a/web/app/components/workflow/comment/mention-input.tsx +++ b/web/app/components/workflow/comment/mention-input.tsx @@ -432,6 +432,10 @@ const MentionInputInner = forwardRef(({ }, [value, mentionedUserIds, onSubmit]) const handleKeyDown = useCallback((e: React.KeyboardEvent) => { + // Ignore key events during IME composition (e.g., Chinese, Japanese input) + if (e.nativeEvent.isComposing) + return + if (showMentionDropdown) { if (e.key === 'ArrowDown') { e.preventDefault()