fix(z-combobox): add aria-label to header for selected filter count (WCAG 2.4.6)#662
Open
ada-workbackai wants to merge 1 commit intomasterfrom
Open
fix(z-combobox): add aria-label to header for selected filter count (WCAG 2.4.6)#662ada-workbackai wants to merge 1 commit intomasterfrom
ada-workbackai wants to merge 1 commit intomasterfrom
Conversation
…(WCAG 2.4.6) Screen readers compute the accessible name from the interactive element (role=combobox or role=button), not from inner spans. Moves the descriptive aria-label from the inner span to the header div, so screen readers announce "Materia: 1 elemento selezionato" instead of the ambiguous "Materia (1)". Uses correct Italian singular/plural forms.
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.
Summary
Fixes WCAG 2.4.6 (Headings and Labels) by moving the descriptive
aria-labelfrom an inner<span>(which has no semantic role) to the header<div>(which hasrole="combobox"orrole="button").Issue: When filters are selected, the button text changes from "Materia" to "Materia (1)". Screen readers announce "Materia (1)" without clarifying what "(1)" means — it could be "1 filter applied", "1 option available", or "1 result". The existing
aria-labelon the inner span is not used by assistive technology for the button's accessible name.Solution: The header
<div>now receivesaria-label="Materia: 1 elemento selezionato"(or plural"N elementi selezionati"), providing clear context for screen reader users. Uses correct Italian singular/plural forms.Note: This PR follows up on the approach from #647, which was closed pending #646 (ZCombobox/ZSelect accessibility restructuring). That prerequisite has since been merged.
Test Plan
yarn build)aria-label)Evidence
View before/after screenshots and full audit details:
https://app.workback.ai/issues/xs9rtj7krbbgyffhmp3vuymgbg/
WCAG Reference:
2.4.6 Headings and Labels