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
fix(tabs): unable to tab to tab content #14808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Along the same line as angular#14808. Fixes not being able to reach the content of a step if it doesn't have focusable content already. Based on the [tabs example from the accessibility guidelines](https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html).
4742e3e
to
e34a290
Compare
Along the same line as #14808. Fixes not being able to reach the content of a step if it doesn't have focusable content already. Based on the [tabs example from the accessibility guidelines](https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html).
Along the same line as #14808. Fixes not being able to reach the content of a step if it doesn't have focusable content already. Based on the [tabs example from the accessibility guidelines](https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html).
Along the same line as #14808. Fixes not being able to reach the content of a step if it doesn't have focusable content already. Based on the [tabs example from the accessibility guidelines](https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html).
e34a290
to
2fada4e
Compare
So it seems there's a team in google3 that is placing an empty tab in one of their test apps which they run accessibility tests against. Because the tab is empty, mat-tab-body has 0 height, resulting in this error:
I'm not sure if this is something we should bother addressing, or just consider it an error on the user's part if they do this in a real app. @jelbourn thoughts? |
It sounds like a problem in their app rather than the tabs itself |
I actually double-checked this against the internal examples built by Google's a11y people and they don't put tabindex on the content. This aligns with my understanding that only interactive elements should be tab stops, and that screen-reader users will navigate to static content via the screen-reader shortcuts (not tab). I have my next a11y sync next Monday, so I'll double check. |
For future reference, this is based on the following example from the W3C: https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html |
@crisbeto I confirmed that we shouldn't make the content tabbable by default. However, when the content is scrollable and it doesn't contain any interactive elements, making the content a tab stop is the only way for users to scroll the content with the keyboard. It seems like the best thing here,then, would be to document what people should do in that case rather than trying to figure it out at the library level. |
2fada4e
to
cdffb03
Compare
Currently the tab's content doesn't have a `tabindex` which means that if it doesn't have any focusable elements, users with assistive technology will skip over the content completely. These changes add a `tabindex` to the content of the currently-selected tab, based on [the example of accessible tabs from the ARIA best practices](https://www.w3.org/TR/wai-aria-practices-1.1/examples/tabs/tabs-2/tabs.html).
cdffb03
to
8096990
Compare
@crisbeto Should this PR be closed in favor of adding better documentation for adding a tabstop when the content is scrollable? |
I think we should close it in favor of not doing anything. We have a similar pattern to this in the stepper and there's a pending PR to remove it since it ends up being more annoying than useful. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently the tab's content doesn't have a
tabindex
which means that if it doesn't have any focusable elements, users with assistive technology will skip over the content completely. These changes add atabindex
to the content of the currently-selected tab, based on the example of accessible tabs from the ARIA best practices.