Skip to content

fix: avoid selecting active option when Enter confirms IME composition#1236

Open
greymoth-jp wants to merge 1 commit into
react-component:14.xfrom
greymoth-jp:fix-ime-composition-enter-select
Open

fix: avoid selecting active option when Enter confirms IME composition#1236
greymoth-jp wants to merge 1 commit into
react-component:14.xfrom
greymoth-jp:fix-ime-composition-enter-select

Conversation

@greymoth-jp

Copy link
Copy Markdown

When the dropdown is open in a searchable Select, the keydown handler in BaseSelect forwards Enter to the option list and selects the active option whenever key === 'Enter', without checking whether that Enter is confirming an IME composition.

So when a user types CJK text (Japanese/Chinese/Korean), the first option is highlighted by defaultActiveFirstOption, and the Enter the user presses to confirm the IME conversion selects that highlighted option before they have finished composing. Selector already guards this for the tags-mode submit with !compositionStatusRef.current, but the option-selection path in BaseSelect was missing the equivalent check.

This shows up on browsers where the Enter that confirms the composition still reports keyCode === 13, the same case the Selector already handles for tags mode. In Chrome the option list's which switch misses it (keyCode is 229 there), but isComposing is set in every browser, so it is the reliable thing to check.

Fix: skip the option-list keydown when the Enter is confirming a composition (event.nativeEvent.isComposing).

Added tests/Composition.test.tsx: a composing Enter no longer fires onChange/onSelect, while a normal Enter still selects the active option. Full suite stays green.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@greymoth-jp is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 416162ec-d6c9-4705-b0d0-0f5803087aa9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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.

1 participant