Skip to content

fix: prevent comment submission during IME composition#8982

Open
717986230 wants to merge 2 commits intomakeplane:previewfrom
717986230:fix-comment-ime-enter-submit
Open

fix: prevent comment submission during IME composition#8982
717986230 wants to merge 2 commits intomakeplane:previewfrom
717986230:fix-comment-ime-enter-submit

Conversation

@717986230
Copy link
Copy Markdown

@717986230 717986230 commented Apr 30, 2026

Summary

Prevents comments from being submitted while an IME composition is in progress.

Changes

  • Checks e.nativeEvent.isComposing before submitting a new comment with Enter.
  • Checks e.nativeEvent.isComposing before submitting an edited comment with Enter.
  • Applies the guard to both wrapper onKeyDown handlers and LiteTextEditor onEnterKeyPress handlers.

Why

When typing Chinese or other IME-based text, pressing Enter can be used to confirm the current composition. Without checking isComposing, the comment can be submitted unexpectedly before the user finishes typing.

Related Issue

Closes #8913

Summary by CodeRabbit

  • Bug Fixes
    • Improved comment submission handling to prevent accidental form submission when composing text using Input Method Editors (IME), ensuring text entry completes before submission.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a50b6753-7d39-42eb-a03a-d3926f0aae0f

📥 Commits

Reviewing files that changed from the base of the PR and between a62fe8a and ae9ad24.

📒 Files selected for processing (2)
  • apps/web/core/components/comments/card/edit-form.tsx
  • apps/web/core/components/comments/comment-create.tsx

📝 Walkthrough

Walkthrough

Two comment submission components have been updated to prevent premature form submission when using IME (Input Method Editor) text composition. The changes add a !e.nativeEvent.isComposing check to the Enter-key handlers, blocking submission attempts triggered during Asian language input composition.

Changes

Cohort / File(s) Summary
IME Composition Awareness
apps/web/core/components/comments/card/edit-form.tsx, apps/web/core/components/comments/comment-create.tsx
Added !e.nativeEvent.isComposing guard to both parent onKeyDown and editor onEnterKeyPress handlers to prevent form submission during IME composition, ensuring Enter keypresses during Asian language input don't prematurely submit comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With whiskers twitching, I detect a fix so neat,
When typing Chinese characters, Enter won't retreat!
The IME knows when fingers dance mid-compose,
No premature submissions—just words, perfectly prose.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: preventing comment submission during IME composition.
Description check ✅ Passed The PR description provides a clear summary, detailed changes, and rationale, but lacks explicit Type of Change, Screenshots, Test Scenarios, and References sections from the template.
Linked Issues check ✅ Passed The PR fully addresses issue #8913 by implementing the necessary checks for e.nativeEvent.isComposing to prevent premature comment submission during IME composition.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the IME composition issue by adding guards to prevent form submission during composition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
Review rate limit: 6/8 reviews remaining, refill in 13 minutes and 6 seconds.

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

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.

[bug]: When commenting on each issue, if it is in Chinese, pressing enter while typing will send it directly.

2 participants