Repository navigation
Fix: respect IME composition state on Enter key send - #16922
Merged
JinHai-CN merged 1 commit intoAug 28, 2026
Merged
Conversation
Pressing Enter to confirm IME (e.g. Japanese) text conversion was incorrectly treated as the send trigger, sending an unintended message before composition was finished. Check event.nativeEvent.isComposing alongside the existing Enter/shiftKey check in NextMessageInput and FloatingChatWidget so composition-confirm Enter presses no longer submit the message.
Contributor
📝 WalkthroughWalkthroughEnter-key submission in the floating chat widget and next message input now ignores IME composition events while preserving existing Shift+Enter behavior and message submission actions. ChangesIME-safe message submission
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1 task done
cike8899
approved these changes
Aug 28, 2026
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pressing Enter to confirm IME (e.g. Japanese/Chinese/Korean) text
composition was incorrectly treated as the chat "send" trigger,
causing an unintended message to be sent before the user finished
composing their input.
Why
NextMessageInputandFloatingChatWidgetboth bind their Enter-to-sendhandler with only
e.key === 'Enter' && !e.shiftKey, without checkingwhether the Enter key press was part of an IME composition
(
event.nativeEvent.isComposing). This is a common pitfall for ReactonKeyDownhandlers and breaks the chat input for CJK IME users.Fix
Added
&& !e.nativeEvent.isComposingto the existing Enter/shiftKeycheck in both components, so Enter presses used to confirm IME
composition no longer trigger message submission.
Testing
Built the patched frontend from source and deployed it against a
running RAGFlow instance (Docker,
docker-ragflow-cpu-1container),then exercised the actual
NextMessageInputtextarea in the AgentCanvas chat panel:
compositionstart-> typed text ->keydown(Enter,isComposing: true) ->compositionend, simulating an IMEconversion-confirm Enter press. Confirmed the textarea content was
preserved and no message was sent.
keydown(Enter,isComposing: false)afterwards on the same input and confirmed the message was sent
and processed by the agent as expected.
Both cases behaved correctly with this fix applied.