-
Notifications
You must be signed in to change notification settings - Fork 355
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 pattern needs to say whether tabpanel should take focus #1164
Comments
In my opinion, in the example 2 tab steps are too much: on the tabpanel and on the link around the graphic. The purpose of the link is not obvious (violation of WCAG 2.4.4). |
To be able to read the contents of the tabpanel: |
@JAWS-test commented:
That's a creative idea. However, as a screen reader user, I'm not convinced it is one we would want to add to the pattern. The up/down behavior Heydon describes for JAWS and NVDA is the behavior in reading mode, not forms or focus mode. When in forms mode, the user can't read the tab panel, so giving it focus isn't helpful. One way of solving that would be to convince the screen reader developers to auto-switch to reading mode when the panel gets focus, regardless of the mechanism for giving it focus. Today, tabbing out of a tablist will typically switch modes if the element receiving focus is not a widget. The nice thing about tabbing is that it is reversable. Down arrow would not be reversable if the user was surprised by the destination. Getting the right mode switching in place, however, would not fix the discoverability problem. This behavior is not part of native tabs. So we would also neet to get the screen readers to tell the user about this feature. The biggest difficulty I see there is that the screen reader would need to have a way of knowing whether or not this feature exists on the page. As of now, we do not have a way of communicating that. This is the kind of thing that could be communicated with control patterns, which is something we have on the roadmap for ARIA 2.0. In the mean time, I don't see a good way of doing this. Another challenge is that we explicitly removed the ability to move the focus in the horizontal tablist with up/down. We received feedback that we should not take away the browser scroll features when focus is in the tab list. That is not a nice thing to do to sighted keyboard users. This, then, sets up a conflict between two different user cohorts. If we take over down arrow for moving focus to the tabpanel, we take scrolling down away from other users. That is similar to tabbing to the tabpanel. It is nice for screen reader users but an inconvenient extra tab stop for sighted keyboard users. Nevertheless, in Tuesday's meeting, the consensus was this is a worthwhile trade off. The group was leaning toard recommending consistently focusing the tabpanel rather than only when there is no interactive content at the top of the tabpanel. There are multiple difficulties introduced by conditional behaviors of that nature. |
@JAWS-test commented:
I am unclear of the rationale for saying there is a WCAG violation. However, please add your comment and explanation to the relevant line in the PR. Please do not respond here. |
I understood Heydon's idea differently: The screenreader remains in form mode with arrow-down, but focus is set to the tabpanel via JavaScript and automatically then the screenreader exits form mode. I liked the idea, but if there are conflicts with other user needs, of course it doesn't work. |
The question was whether the focus had to be on the tab panel by Tab key. I say: No, because in the example there is no content in the tabpanel except for the link that gets the focus anyway. Whether the other tab steps are useful or superfluous is hard for me to decide, because the links currently only contain a # in the href. But I can hardly imagine that the link around the graphic has a different link target than the link inside the graphic. So we probably have 2 links with the same destination and different labels. Unnecessary and confusing |
I agree with this. This is similar to how a cell in a grid doesn’t get focus when there’s a focusable widget (such as a link) inside of it. |
PR #1274 proposes to resolve this issue with the following description of the Tab key in the keyboard interaction section of the Tabs Pattern:
|
This issue was raised during discussion of pull #1120.
The tabpanel in the tabbed carousel example has
tabindex="0"
, which seems like an unnecessary tab stop. The Tabs Pattern doesn't say whether the tabindex is optional or required. One reason to make it required would be so that the experience is consistent across tabpanels. Another would be to ensure that non-interactive child content is read.The text was updated successfully, but these errors were encountered: