Skip to content

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

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

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

Conversation

@kanayagawa

@kanayagawa kanayagawa 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.

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 Enter key behavior across comment editing forms, comment creation, page title editing, assistant modal, and the editor extension to properly handle Input Method Editor (IME) text composition. This prevents unintended form submissions and editor actions when users are actively composing text using IME input methods for languages that require character composition.

…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: b043bff2-b003-44be-987a-d3990d2663e5

📥 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

This PR adds Input Method Editor (IME) composition state checks across multiple Enter key handlers to prevent unintended form submission while users are composing text using IME input methods. Changes apply a consistent guard pattern to both form submission handlers and the core editor extension.

Changes

IME Composition State Handling

Layer / File(s) Summary
Form handlers IME composition fix
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
Add !e.nativeEvent.isComposing or !event.isComposing guards to Enter key handlers in four UI components so submission only triggers when IME composition is not active.
Editor extension IME composition fix
packages/editor/src/core/extensions/enter-key.ts
Check this.editor.view.composing state in the Enter key shortcut handler and return false early if composing, bypassing subsequent newline and dropbar handling during IME text composition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 When fingers dance with IME dreams,
And characters flow in composing streams,
Our Enter key now knows to pause,
Respecting the rules of composition's cause!
No premature submit shall break the spell—
IME and forms together dwell.

🚥 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 accurately and specifically describes the main change: preventing Enter during IME composition from submitting comments and other inputs.
Description check ✅ Passed The description includes detailed context (problem), specific changes (affected files), testing confirmation, and type of change checkbox. All required sections are present and complete.
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.

@kanayagawa

Copy link
Copy Markdown
Author

Closing in favor of #pending — resubmitting from the correct account. Apologies for the noise.

@kanayagawa

Copy link
Copy Markdown
Author

Resubmitted as #9229.

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.

3 participants