Skip to content

fix: Prevent duplicate keydown triggers during IME composition causing duplicate options in Creatable - #6104

Open
phungquan27-05 wants to merge 2 commits into
JedWatson:masterfrom
phungquan27-05:phungquan27-05-patch-1
Open

phungquan27-05 wants to merge 2 commits into
JedWatson:masterfrom
phungquan27-05:phungquan27-05-patch-1

Conversation

@phungquan27-05

Copy link
Copy Markdown

Summary

Fixes an issue where pressing Enter to confirm IME composition (e.g. Vietnamese, Japanese on macOS) triggers Enter actions twice or prematurely executes props.onKeyDown.

This issue is especially noticeable in Creatable inputs: when users press Enter to finish IME composition and create a new option, the component may process the same Enter event twice, resulting in two identical options being created instead of one.

What changed

  • Added an early return at the beginning of onKeyDown when event.nativeEvent.isComposing or event.keyCode === 229.

  • Prevents composition keydown events from leaking into the onKeyDown callback prop and internal select handlers.

  • Ensures that Enter pressed during IME composition is ignored until composition is fully completed, preventing duplicate option creation and unintended key handling.

Ignore keydown events during IME composition to prevent duplicate triggers.
@changeset-bot

changeset-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e9a6e6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-select Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented Sep 17, 2026

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Prevent duplicate keydown triggers during IME composition.
@phungquan27-05 phungquan27-05 changed the title Prevent duplicate keydown triggers during IME composition fix: Duplicate keydown triggers during IME composition Sep 17, 2026
@phungquan27-05 phungquan27-05 changed the title fix: Duplicate keydown triggers during IME composition fix: Prevent duplicate keydown triggers during IME composition causing duplicate options in Creatable Sep 17, 2026
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