primer / view_components

ViewComponents for the Primer Design System
https://primer.style/components/
MIT License
449 stars 114 forks source link

[SelectPanel] Fix tab index issue in multi-select mode #3077

Closed camertron closed 5 days ago

camertron commented 5 days ago

Authors: Please fill out this form carefully and completely.

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans. Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

@kendallgassner discovered a bug in the SelectPanel component affecting keyboard navigation for multi-select panels. Steps to reproduce:

  1. Open the panel and focus on the filter input. Press Tab.
  2. Observe that focus moves to the first item.
  3. Focus on the filter input and enter text that causes the first item to be hidden, i.e. be filtered out.
  4. Clear the filter input and press Tab.
  5. Observe that focus does not move to the first item (which is unexpected).

Screenshots

Video alt: A screen recording demonstrating that the first item is initially tabbable but cannot be reached after filtering.

https://github.com/user-attachments/assets/037251a6-57d8-4bc7-b123-dee36f97b344

Integration

No changes necessary in production.

Risk Assessment

Accessibility

Merge checklist

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

changeset-bot[bot] commented 5 days ago

🦋 Changeset detected

Latest commit: 30acd0a40c070d627275e135bbad3385ada06b90

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

This PR includes changesets to release 1 package | Name | Type | | ----------------------- | ----- | | @primer/view-components | 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

camertron commented 5 days ago

In the interest of time, I'm going to use my admin rights and merge this.