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

ComboboxControl: the Reset button doesn't work when using the keyboard #63408

Closed
afercia opened this issue Jul 11, 2024 · 0 comments · Fixed by #63410
Closed

ComboboxControl: the Reset button doesn't work when using the keyboard #63408

afercia opened this issue Jul 11, 2024 · 0 comments · Fixed by #63410
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jul 11, 2024

Description

Discovered while testing the 'Parent' setting for a post of type page.

Screenshot 2024-07-11 at 10 06 45

Can be reproduced on the storybook as well, by enabling the allowReset prop.

When using the keyboard, pressing the Enter key on the optional Reset button doesn not reset the combobox. Pressing the Spacebar key does work.

Turns out when pressing the Enter key, the keydown event attached on the container div element fires and actually sets the currently selected suggestion.

Step-by-step reproduction instructions

  • Edit a page and use the Parent setting with the keyboard.
  • Alternatively, test on the storybook, make sure the allowReset prop is set to true: https://wordpress.github.io/gutenberg/?path=/story/components-comboboxcontrol--default&args=allowReset:!true
  • Select a suggestion.
  • Click the reset button with your mouse.
  • The combobox is reset.
  • I would expect the same behavior when using the keyboard.
  • Select a suggestion.
  • Move focus to the Reset button.
  • Press the Spacebar key and observe it does reset the combobox.
  • Repeat, but this time press the Enter key and observe it does not reset the comobox.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components labels Jul 11, 2024
@afercia afercia self-assigned this Jul 11, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 11, 2024
@afercia afercia changed the title Combobox: the Reset button doesn't work when using the keyboard Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
1 participant