-
Notifications
You must be signed in to change notification settings - Fork 321
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
Use generic div element for tabspanel #1746
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.
Looks good 👍
We had a chat about whether we should inform users about this in the release notes in our next breaking release but since there is no change in behaviour we don't think it's necessary to do that.
Sections when they have an accessible name create landmarks. > The use of region landmarks should be limited, as too many landmarks can dilute their usefulness in quickly navigating to important areas of a page. If you find there are many landmarks, especially generic regions existing in a single page, then the page’s structure should be reexamined. - https://www.scottohara.me/blog/2018/03/03/landmarks.html Also, when the component has not be enhanced these sections do not have accessible names so it means they are the equivalent of a div already. When they're enhanced they're given a role of tabpanel, so they're no longer a section. Given this I'm not sure it was ever useful and by making them generic divs we can avoid HTML validators warning about this component. Closes #1339
72068e3
to
0ddb915
Compare
As I remember, on the initial implementation of tabs component a (potentially visually hidden) heading was meant to be automatically generated for each section acting as identifier (as exemplified in the Design System) – hence passing the HTML validation. |
Sections when they have an accessible name create landmarks.
Also, when the component has not be enhanced these sections do not have
accessible names so it means they are the equivalent of a div already.
When they're enhanced they're given a role of tabpanel, so they're no
longer a section.
Given this I'm not sure it was ever useful and by making them generic
divs we can avoid HTML validators warning about this component.
Closes #1339