[Tabs] Accessibility improvments #2942
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature Request
Is your feature request related to a problem? Please describe.
In a recent accessibility audit, it was observed that the Tabs component does not follow the structure of the W3C design pattern : Tabs indicator should use the "button" tag with the role="tab" (element with"button" tag already have an implicit "tabindex" and natively support the enter/space keyboard activation)
To take into account the case of multiple tabs (or tabs with a long text content), we organized some user test. It seems that it's better to have all the tabs in one row in desktop and mobile with an horizontal scroll. To fix-it, we also add a tabindex="0" attribute on the tablist container and we do a small improvement to the CSS file.
We are also thinking about adding an "Orientation" parameter to describe if the tablist will be displayed horizontally or vertically ( branch also available on github)
Environment
AEM 6.5
Core Components version 2.28.0
Documentation
We have to implement the properties specified in the design pattern of tabs :
https://www.w3.org/WAI/ARIA/apg/patterns/tabs/