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

Tabs control: tabpanel needs to be in tab order if there's no focusable tabpanel content #7078

Closed
Tracked by #7860
carmacleod opened this issue Oct 19, 2020 · 1 comment · Fixed by #7894
Closed
Tracked by #7860
Assignees
Labels

Comments

@carmacleod
Copy link
Contributor

Steps:

  • Open the Tabs control example
  • Type the Tab key - focus moves to "Tab Label 2"
  • Type the Tab key again - focus should move into the tabpanel (i.e. the div containing "Content for second tab...") but instead, it goes to the browser's location bar.

The APG Guidance for Tabs component says that if focus is in the tablist and the user types the Tab key:

... move focus to the next element in the page tab sequence outside the tablist, which is the tabpanel unless the first element containing meaningful content inside the tabpanel is focusable.

The Carbon Tabs component doesn't need to know what focusable element inside the tabpanel contains meaningful content. :)
It only needs to know whether or not any of the tabpanel content is focusable. If none are, then the tabpanel itself needs to be focusable (i.e. have tabindex="0").

Here's how one Tabs component decided on a prop for this: point 2 in juanca/react-aria-components#6
based on this comment in issue w3c/aria-practices#323 (comment).

Happy to talk this through before anything is coded.

@dakahn
Copy link
Contributor

dakahn commented Oct 26, 2020

Wow, that's a really good catch. The use case you describe in w3c/aria-practices#323 (comment) is totally reasonable. Thank you so much for bringing this to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants