-
Notifications
You must be signed in to change notification settings - Fork 9
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
refactor(elements|ino-tab-bar): accessible ino-tab-bar #1098
Conversation
buttonElement.setAttribute('aria-selected', isSelected.toString()); | ||
if (panelId) { | ||
buttonElement.setAttribute('aria-controls', panelId); | ||
} |
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.
These lines assume the internal structure of the <ino-tab>
component and therefore have too much knowledge. As soon as we do some refactoring of our tab component, we won't really realize that we might be breaking things.
That's why I would propose to implement these lines as properties of the <ino-tab>
component. They could be named like our other accessibility props (e.g. a11ySelected
and a11yControls
) and just set these values to the internal button
element. We also should write a disclaimer in the comments that these properties are managed by the ino-tab-bar
component.
This way, the ino-tab-bar
uses only the public API of our ino-tab
.
Closes #1002
Note on Accessibility Implementations for Tab Panels
Our
ino-tab
andino-tab-bar
components focus on providing the tab and the tablist functionality. We do not control or provide the tab panels, as these are part of the user's content implementation. To support accessibility, I added apanelId
property to theino-tab
component. This enables users to link each tab with its corresponding content panel for accessibility purposes, following WAI-ARIA practices. However, the actual implementation of tab panels and their accessibility attributes (role="tabpanel"
,aria-labelledby
, etc.) is under the user's control.