fix: prevent IME composition Enter from triggering submit actions#8893
fix: prevent IME composition Enter from triggering submit actions#8893tony140407 wants to merge 1 commit intomakeplane:previewfrom
Conversation
CJK input methods (Chinese Zhuyin, Japanese IME, Korean) use Enter to confirm character selection during composition. This conflicts with Enter-to-submit handlers across the app, causing premature submissions. Add isComposing + keyCode 229 checks to 5 locations: - Comment create and edit forms - GPT assistant prompt input - Link edit view and link selector in editor Addresses: makeplane#5485, makeplane#7022 Related: makeplane#7084, makeplane#8425 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds IME composition detection guards ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Pull request overview
Prevents Enter key presses used to confirm IME (CJK) composition from unintentionally triggering submit actions across comment inputs and other Enter-to-submit text fields in the web app and editor UI.
Changes:
- Added an IME-composition guard (
isComposing+keyCode === 229fallback) to Enter key handlers in comment create/edit flows. - Added the same guard to AI assistant prompt submission (global keydown handling).
- Added the same guard to editor link editing/selection inputs to avoid premature link submit while composing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx | Ignore IME composition Enter before running Enter-to-submit link handler. |
| packages/editor/src/core/components/links/link-edit-view.tsx | Ignore IME composition Enter before applying/closing link edits. |
| apps/web/core/components/core/modals/gpt-assistant-popover.tsx | Ignore IME composition Enter in the global Enter-to-submit listener while popover is open. |
| apps/web/core/components/comments/comment-create.tsx | Ignore IME composition Enter in the wrapper keydown submit handler. |
| apps/web/core/components/comments/card/edit-form.tsx | Ignore IME composition Enter in the wrapper keydown submit handler. |
Description
Fix IME (Input Method Editor) composition conflict with Enter key
in comment inputs and other text fields.
When using CJK input methods (Chinese Zhuyin/Bopomofo, Japanese IME,
Korean IME), pressing Enter to confirm character selection
unintentionally triggers form submission. On macOS, pressing Enter
during IME composition still fires a
keydownevent, and existinghandlers did not check for active composition state.
Changes (5 files)
Comment inputs (improved upon PR #8425 by @LinEvil):
comment-create.tsx— addedisComposing+keyCode === 229guardedit-form.tsx— sameOther CJK text input areas (new):
gpt-assistant-popover.tsx— AI assistant prompt inputlink-edit-view.tsx— link text editing in editorlink-selector.tsx— link selector in editorNote on EnterKeyExtension (ProseMirror plugin)
During investigation, CodeRabbit flagged in PR #8425 that the
Tiptap
EnterKeyExtensioncould be a second pathway forEnter-triggered submission. After deeper analysis, I found that
ProseMirror's core already guards against this — its
editHandlers.keydowncallsinOrNearComposition(view, event)which checks
view.composingand includes a 500ms grace periodfor Safari's
compositionendtiming. This meansaddKeyboardShortcutsin Tiptap extensions are never invokedduring IME composition in the first place, so no fix is needed
at that layer.
Guard pattern
keyCode === 229is a fallback for browsers wherecompositionendfires beforekeydown, causingisComposingto already be
falseon the final confirmation Enter.Relationship to existing PRs
This PR builds on @LinEvil's work with
keyCode === 229fallback and extends coverage to additional input areas.
Type of Change
Test Scenarios
composition confirms character, does NOT submit
References
Closes #5485
Related: #7022, #7084, #8425
Summary by CodeRabbit
Bug Fixes