Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combobox component usability issue when there is an existing selection and a new selection is typed #33920

Closed
3 tasks done
mikejolley opened this issue Aug 6, 2021 · 0 comments · Fixed by #33928
Closed
3 tasks done
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mikejolley
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Have you tried deactivating all plugins except Gutenberg?

  • I have tested with all plugins deactivated.

Have you tried replicating the bug using a default theme e.g. Twenty Twenty?

  • I have tested with a default theme.

Description

Filtering the results of the combobox and pressing the enter key leads to an unexpected selection, ignoring your input.

The code responsible for this behaviour is here: https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/combobox-control/index.js#L112-L117

Step-by-step reproduction instructions

  1. Go to the Storybook demo of combobox https://wordpress.github.io/gutenberg/?path=/story/components-comboboxcontrol--default
  2. Select Aland Islands in the combobox control.
  3. Type "France". You'll see only once match show. Press the keyboard enter key only (do not arrow down to France).
  4. Aland Islands is still selected. Any text you input is cleared.

Expected Behavior

If you filter the list and press enter, the top match should be selected.

Current Behavior

If you filter the list and press enter, the previous match is selected.

Screenshots or screen recording (optional)

No response

Code snippet (optional)

No response

WordPress Information

No response

Gutenberg Information

No response

What browsers are you seeing the problem on?

No response

Device Information

No response

Operating System Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants