Skip to content

fix: prevent Enter during IME composition from submitting comments and other inputs#9229

Open
bgngToshi wants to merge 1 commit into
makeplane:previewfrom
bgngToshi:fix/ime-composition-enter-submit
Open

fix: prevent Enter during IME composition from submitting comments and other inputs#9229
bgngToshi wants to merge 1 commit into
makeplane:previewfrom
bgngToshi:fix/ime-composition-enter-submit

Conversation

@bgngToshi

@bgngToshi bgngToshi commented Jun 11, 2026

Copy link
Copy Markdown

Description

When typing Japanese (or Chinese/Korean) text with an IME, pressing Enter to 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 isComposing checks so that Enter during IME composition only confirms the conversion and never triggers a submit:

  • comment-create.tsx / comment edit-form.tsx — keydown handlers now ignore composition Enter
  • EnterKeyExtension (@plane/editor) — returns false while editor.view.composing
  • gpt-assistant-popover.tsx — window keydown handler ignores composition Enter
  • pages/editor/title.tsx — title field no longer moves focus on composition Enter

The check pattern (!e.nativeEvent.isComposing) follows the existing convention already used in label-select.tsx and label-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:types and pnpm check:lint pass (web + @plane/editor)
  • Verified at runtime on a self-hosted CE instance (v1.3.1, patch cherry-picked, frontend image rebuilt): with Japanese IME, Enter now confirms the conversion without posting the comment; comment editing, page title, and normal Enter-to-submit (composition finished) all behave as expected.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Bug Fixes
    • Fixed unintended submissions triggered by pressing Enter during text composition in comments, editors, and input fields. The Enter key will now only trigger actions after text composition is complete.

…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
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4448648f-3a75-416a-999f-975d5d45bc09

📥 Commits

Reviewing files that changed from the base of the PR and between fd16d03 and 370edb4.

📒 Files selected for processing (5)
  • apps/web/core/components/comments/card/edit-form.tsx
  • apps/web/core/components/comments/comment-create.tsx
  • apps/web/core/components/core/modals/gpt-assistant-popover.tsx
  • apps/web/core/components/pages/editor/title.tsx
  • packages/editor/src/core/extensions/enter-key.ts

📝 Walkthrough

Walkthrough

Enter 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.

Changes

IME Composition Guards

Layer / File(s) Summary
React component Enter handlers
apps/web/core/components/comments/card/edit-form.tsx, apps/web/core/components/comments/comment-create.tsx, apps/web/core/components/core/modals/gpt-assistant-popover.tsx, apps/web/core/components/pages/editor/title.tsx
Comment edit form, comment create, GPT assistant popover, and page title editor now check !e.nativeEvent.isComposing before triggering Enter key submission, preventing accidental submission during IME text composition.
TipTap editor Enter extension
packages/editor/src/core/extensions/enter-key.ts
Enter key shortcut handler checks this.editor.view.composing and returns early when composition is active, blocking Enter behavior during IME input.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 When Enter keys dance but the text still speaks,
IME's whispered notes through composition peeks,
We guard with care, let letters flow free,
No premature submission—just harmony!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: preventing Enter key submissions during IME composition across multiple input surfaces.
Description check ✅ Passed The description includes all required sections: detailed explanation of the problem, type of change (bug fix), testing verification, and related issue references. All key information is present and well-structured.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant

CLAassistant commented Jun 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants