fix(a11y-tabs): improve a11y compliance of the tabs component [AC-4742] - #1407
Open
Stefan3002 wants to merge 1 commit into
Open
fix(a11y-tabs): improve a11y compliance of the tabs component [AC-4742]#1407Stefan3002 wants to merge 1 commit into
Stefan3002 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Tabs component’s rendered markup to better align with the WAI-ARIA Tabs pattern by introducing explicit ARIA roles so that consumers can build on top of a more semantically-correct baseline.
Changes:
- Adds
role="tablist"to the tabs<ul>. - Removes
<li>from the accessibility tree via a presentational role. - Adds
role="tab"to the link/component rendered inside each list item.
Comments suppressed due to low confidence (1)
src/components/Tabs/Tabs.tsx:79
role="tab"introduces the ARIA Tabs pattern, but the component does not currently implement the rovingtabIndexthat the APG requires for keyboard navigation. Also, ifactiveis omitted,aria-selectedis not set at all. Consider defaultingaria-selectedto a boolean and settingtabIndexbased onactiveso that only the selected tab is tabbable.
<Component
role="tab"
aria-selected={active}
className={classNames("p-tabs__link", className)}
data-testid={`tab-link-${label}`}
{...rest}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stefan3002
force-pushed
the
tabs-a11y-fixes
branch
from
July 28, 2026 11:30
10f3b5e to
365c68d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
src/components/Tabs/Tabs.tsx:72
rolemust be a single valid ARIA role token.role="none presentation"is invalid and may be ignored by assistive tech; use eithernoneorpresentation(they’re synonyms) to remove the<li>from the accessibility tree.
role="none presentation"
src/components/Tabs/Tabs.tsx:78
- With
role="tab", the element should participate in the roving tabIndex pattern andaria-selectedshould always be a boolean. Currentlyaria-selectedcan beundefined(omitting the attribute) and notabIndexis set, which is out of alignment with the APG tabs pattern.
<Component
role="tab"
aria-selected={active}
className={classNames("p-tabs__link", className)}
data-testid={`tab-link-${label}`}
edlerd
approved these changes
Aug 4, 2026
edlerd
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for the fixes!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Done
element is the "tablist" as users can't do that from the outside.- Also, the content of the
- has also a role of "tab"
- The
- should be removed from a11y engines, as they sit in-between the "tablist" and the "tab". The realtion between the two MUST be parent-child.
Note: Here, you can see: "Until implementations include sufficient support for role="none", web authors are advised to use the presentation role alone role="presentation" or redundantly as a fallback to the none role role="none presentation"."
QA
Check that the three changes adhere to this guideline.
Fixes
Fixes: #AC-4742