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

Remove non-tab elements from TabNav focus zone #2367

Conversation

iansan5653
Copy link
Contributor

When there are focuseable elements inside TabNav (particularly inside the Tabs themselves) they should not be included in the arrow-key navigation. For example, this menu button should be focuseable via Tab, not via arrow keys:

Screenshot of the Projects view tab menu anchor button, focused.

This change filters out any elements without the role tab from the focus zone. This fixes #2319 - for more context, please see that issue.

Merge checklist

  • Added/updated tests
  • [ ] Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

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

@iansan5653 iansan5653 requested a review from a team September 23, 2022 16:05
@iansan5653 iansan5653 self-assigned this Sep 23, 2022
@iansan5653 iansan5653 linked an issue Sep 23, 2022 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2022

🦋 Changeset detected

Latest commit: c8f19ac

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 23, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 77.1 KB (+0.03% 🔺)
dist/browser.umd.js 77.71 KB (+0.03% 🔺)

@iansan5653 iansan5653 temporarily deployed to github-pages September 23, 2022 16:17 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@iansan5653 iansan5653 enabled auto-merge (squash) September 23, 2022 18:06
@iansan5653 iansan5653 temporarily deployed to github-pages September 23, 2022 18:14 Inactive
@iansan5653 iansan5653 merged commit 252a605 into main Sep 23, 2022
@iansan5653 iansan5653 deleted the 2319-tabnav-should-exclude-buttons-within-tabs-from-the-focus-zone branch September 23, 2022 18:16
@primer-css primer-css mentioned this pull request Sep 23, 2022
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.

TabNav should exclude buttons within tabs from the focus zone
3 participants