plane icon indicating copy to clipboard operation
plane copied to clipboard

fix: prevent prematurely triggered IME comment creation

Open LinEvil opened this issue 1 week ago โ€ข 2 comments

Description

When using IME for multi-language input (e.g., typing Chinese followed by English), pressing Enter during composition incorrectly submitted the comment. This happened because the Enter key event did not properly check for native composition state.

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] Feature (non-breaking change which adds functionality)
  • [ ] Improvement (change that would cause existing functionality to not work as expected)
  • [ ] Code refactoring
  • [ ] Performance improvements
  • [ ] Documentation update

Screenshots and Media (if applicable)

Typing Pressing Enter during IME composition prematurely submitted the comment: Before Expected Behavior (After Fix): After

Test Scenarios

  • Verified that comments using Chinese/Japanese IME are not prematurely submitted
  • Confirmed that normal English input workflow remains unaffected

References

https://github.com/makeplane/plane/pull/7084 https://github.com/makeplane/plane/issues/7022 https://github.com/makeplane/plane/issues/7496 https://github.com/makeplane/plane/issues/5485


[!NOTE] Fixes premature comment submission when using IME by making Enter-to-submit respect composition state.

  • Adds !e.nativeEvent.isComposing check to Enter key handlers in comment-create.tsx and comments/card/edit-form.tsx
  • Ensures comments aren't submitted during active text composition while preserving normal Enter behavior

Written by Cursor Bugbot for commit a5ac3821d8599c68f81d62909e932e7668700ca5. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where pressing Enter during text input composition (IME) could prematurely submit comments. Submission now waits for composition to complete, improving typing and submission behavior in comment creation and edit inputs for languages using input method editors.

โœ๏ธ Tip: You can customize this high-level summary in your review settings.

LinEvil avatar Dec 23 '25 06:12 LinEvil

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

๐Ÿ“ Walkthrough

Walkthrough

Adds IME composition checks to Enter-key handlers in comment input components to prevent form submission while an input method editor (IME) is composing.

Changes

Cohort / File(s) Summary
Comment creation input
apps/web/core/components/comments/comment-create.tsx
Require !e.nativeEvent.isComposing in the Enter key onKeyDown condition to avoid submit during IME composition.
Comment edit form input
apps/web/core/components/comments/card/edit-form.tsx
Same change: add !e.nativeEvent.isComposing to Enter key onKeyDown check to prevent IME-triggered submissions.

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~10 minutes

Pre-merge checks and finishing touches

โœ… Passed checks (3 passed)
Check name Status Explanation
Title check โœ… Passed The title clearly and concisely summarizes the main change: preventing premature comment creation when using IME input composition.
Docstring Coverage โœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check โœ… Passed The pull request description comprehensively covers all required template sections with clear details about the IME composition bug, type of change classification, before/after screenshots, specific test scenarios, and related issue references.
โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

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.

coderabbitai[bot] avatar Dec 23 '25 06:12 coderabbitai[bot]

Hi @vamsikrishnamathala @prateekshourya29 , could you please help review this PR?

LinEvil avatar Dec 23 '25 11:12 LinEvil