fix: prevent Enter during IME composition from submitting comments and other inputs#9229
fix: prevent Enter during IME composition from submitting comments and other inputs#9229bgngToshi wants to merge 1 commit into
Conversation
…d other inputs When typing with an IME (Japanese, Chinese, Korean), pressing Enter to confirm a text conversion was being treated as a submit action, causing comments to be posted mid-composition. Add isComposing checks to the comment create/edit keydown handlers, the editor EnterKeyExtension, the AI assistant popover, and the page title input. Fixes makeplane#7022
|
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)
📝 WalkthroughWalkthroughEnter key submission is now guarded against IME text composition across React components and the TipTap editor. Comment forms, the GPT assistant popover, and page title editor check DOM event composition state. The editor extension checks the editor's internal composition state. All changes follow the same pattern: early return when composition is active. ChangesIME Composition Guards
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Description
When typing Japanese (or Chinese/Korean) text with an IME, pressing
Enterto confirm a text conversion is treated as a submit action. This causes issue comments to be posted mid-composition, page title editing to lose focus, and the AI assistant prompt to be submitted prematurely.This PR adds
isComposingchecks so that Enter during IME composition only confirms the conversion and never triggers a submit:comment-create.tsx/ commentedit-form.tsx— keydown handlers now ignore composition EnterEnterKeyExtension(@plane/editor) — returnsfalsewhileeditor.view.composinggpt-assistant-popover.tsx— window keydown handler ignores composition Enterpages/editor/title.tsx— title field no longer moves focus on composition EnterThe check pattern (
!e.nativeEvent.isComposing) follows the existing convention already used inlabel-select.tsxandlabel-dropdown.tsx.Related: #7022, and complements #8915 (credit to @wang2032 for the editor extension approach) by covering additional input surfaces.
(Resubmission of #9228 from the correct account — identical change.)
Testing
pnpm check:typesandpnpm check:lintpass (web + @plane/editor)Type of change
Summary by CodeRabbit