Skip to content
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

Merged
merged 5 commits into from
Dec 8, 2023

Conversation

TobiasHeimGalindo
Copy link
Collaborator

Closes #1002

Note on Accessibility Implementations for Tab Panels

Our ino-tab and ino-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 a panelId property to the ino-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.

@janivo janivo changed the title refactor(ino-tab-bar): accessible ino-tab-bar refactor(elements|ino-tab-bar): accessible ino-tab-bar Nov 16, 2023
Comment on lines 60 to 63
buttonElement.setAttribute('aria-selected', isSelected.toString());
if (panelId) {
buttonElement.setAttribute('aria-controls', panelId);
}
Copy link
Collaborator

@janivo janivo Nov 16, 2023

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.

@janivo janivo enabled auto-merge (squash) December 8, 2023 09:44
@janivo janivo merged commit 70b0523 into master Dec 8, 2023
5 of 6 checks passed
@janivo janivo deleted the elements-#1002-accessible-ino-tab-bar branch December 8, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessible InoTabBar
2 participants