brand
brand copied to clipboard
🐛 [BUG] - `AnchorNav` focus is trapped on mobile
Describe the bug
This came up in this accessibility audit. Once the focus is inside the menu, the focus is trapped and you can't get out of it with the tab key.
Reproduction steps
- Go to Storybook
- Resize browser to mobile (~500px until nav "collapses")
- Use keyboard
tabto navigate - Once focus is on "GitHub vs Jenkins", you can only use up/down keys, but
tabkey doesn't work anymore and you can't reach the "Sign up" button.
Expected behavior
- Go to Storybook
- Resize browser to mobile (~500px until nav "collapses")
- Use keyboard
tab+enterto navigate - Once focus is on "GitHub vs Jenkins" and you press the
tabkey, the focus should move to the "Sign up" button and not be "trapped" in the menu.
Screenshots
https://github.com/primer/brand/assets/378023/5f87d5b8-2a76-446a-8a4f-a55ce8d9c42a
Browsers
Chrome
OS
Mac
FYI: Here another comment from a follow-up review.