Skip to content

fix(ui): ignore Enter during IME composition in select dropdowns#9331

Open
greymoth-jp wants to merge 1 commit into
makeplane:previewfrom
greymoth-jp:fix/dropdown-ime-composition-enter
Open

fix(ui): ignore Enter during IME composition in select dropdowns#9331
greymoth-jp wants to merge 1 commit into
makeplane:previewfrom
greymoth-jp:fix/dropdown-ime-composition-enter

Conversation

@greymoth-jp

@greymoth-jp greymoth-jp commented Jun 28, 2026

Copy link
Copy Markdown

Description

MultiSelectDropdown and SingleSelectDropdown attach their Combobox onKeyDown to useDropdownKeyPressed, which calls onEnterKeyDown (toggleDropdown) on every Enter. The search input inside the dropdown only stops propagation for Escape, so the Enter that confirms an IME composition bubbles up from the input to the combobox and toggles the dropdown closed before anything is selected.

For a CJK IME (Japanese, Chinese, Korean), the first Enter is meant to commit the conversion, not to act on the dropdown. As a result the search field is hard to use with an IME: committing the text closes the menu.

The sibling hook useDropdownKeyDown already guards against this with !event.nativeEvent.isComposing. This change applies the same guard to useDropdownKeyPressed. Non-IME Enter is unaffected (isComposing is false), so it still toggles as before; only the Enter that ends a composition is ignored.

Type of Change

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

Screenshots and Media (if applicable)

Test Scenarios

With an IME enabled (for example Japanese):

  1. Open a dropdown backed by MultiSelectDropdown or SingleSelectDropdown with search enabled.
  2. Type into the search field and press Enter to confirm the IME conversion.
  3. Before this change the dropdown closes. After it, the conversion is committed and the dropdown stays open.

Without an IME, pressing Enter still toggles the dropdown exactly as before.

I verified by inspection that this matches the existing useDropdownKeyDown guard and leaves non-composing Enter unchanged. I don't have a CJK IME configured locally to run the end-to-end flow, so a confirmation from someone who does would be welcome.

References

The !event.nativeEvent.isComposing guard already exists in useDropdownKeyDown (packages/ui/src/hooks/use-dropdown-key-down.tsx) and in the label create handlers; this brings useDropdownKeyPressed in line. IME Enter handling has come up before in Plane (for example #7022).

Summary by CodeRabbit

  • Bug Fixes
    • Improved keyboard behavior in dropdowns by preventing the Enter key action from firing during text input composition, helping users with IME input avoid accidental selections.

MultiSelectDropdown and SingleSelectDropdown pass their Combobox
onKeyDown through useDropdownKeyPressed, which calls onEnterKeyDown
(toggleDropdown) on every Enter. While filtering with an IME, the
Enter that confirms a composition bubbles up from the search input
and closes the dropdown. Skip Enter while nativeEvent.isComposing,
mirroring the guard already in useDropdownKeyDown.
@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

coderabbitai Bot commented Jun 28, 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: 0bcc5141-1043-456e-8d9a-22544655b103

📥 Commits

Reviewing files that changed from the base of the PR and between 90ae845 and 758dcb7.

📒 Files selected for processing (1)
  • packages/ui/src/hooks/use-dropdown-key-pressed.ts

📝 Walkthrough

Walkthrough

In useDropdownKeyPressed, the handleKeyDown function's Enter key branch now additionally checks !event.nativeEvent.isComposing, preventing the Enter callback from firing while an IME composition is in progress.

Changes

IME Composition Guard

Layer / File(s) Summary
Enter key IME guard
packages/ui/src/hooks/use-dropdown-key-pressed.ts
The Enter key condition now includes !event.nativeEvent.isComposing to skip the callback during active IME composition.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 A single line, a tiny fix,
No more Enter causing tricks,
While composing characters fair,
The dropdown stays without a care,
IME and I now play it right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main bug fix: ignoring Enter during IME composition in select dropdowns.
Description check ✅ Passed The description follows the template well and includes the required sections with a clear explanation, type, tests, and references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

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