-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(editor): prevent premature submission during IME composition #8558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes add IME (Input Method Editor) composition guards across the comment submission system and editor extensions to prevent unintended submissions and operations during Chinese/Japanese/Korean text input. Guard clauses now check composition state before triggering Enter key submissions, emoji replacements, trailing node insertions, and unique ID generation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where comments were being submitted prematurely when using Chinese, Japanese, or Korean (CJK) input methods (IME). The issue occurred when users pressed Enter to select a character from the IME candidate list, which triggered comment submission instead of completing character selection.
Changes:
- Added IME composition checks to editor extensions to prevent document modifications during character composition
- Added IME composition checks to React event handlers to prevent form submission during character selection
- Passed editor instance to plugins that need to check composition state
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/editor/src/core/extensions/unique-id/plugin.ts | Added editor parameter and IME composition check in appendTransaction to skip ID generation during composition |
| packages/editor/src/core/extensions/unique-id/extension.ts | Updated plugin instantiation to pass editor instance |
| packages/editor/src/core/extensions/trailing-node.ts | Added IME composition check to prevent trailing node insertion during composition |
| packages/editor/src/core/extensions/enter-key.ts | Added IME composition check to prevent Enter key handling during character selection |
| packages/editor/src/core/extensions/emoji/emoji.ts | Added IME composition check to prevent emoji replacement during composition |
| apps/web/core/components/comments/comment-create.tsx | Added isComposing check to prevent form submission during IME composition |
| apps/web/core/components/comments/card/edit-form.tsx | Added isComposing check to prevent form submission during IME composition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @anmolsinghbhatia, could you help review this PR when you have time? It fixes an IME composition bug affecting CJK input users in the editor/comments. The changes touch |
Description
Fixes the issue where comments are submitted prematurely when using Chinese/Japanese/Korean input methods (IME). When pressing Enter to select a character from the candidate list, the comment was being submitted instead of completing the character selection.
Type of Change
Screenshots and Media (if applicable)
Screen.Recording.2026-01-19.at.1.48.15.AM.mov
Test Scenarios
References
Fixes #4134
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.