Skip to content

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
workbackai/fix/wcag-2.4.6-combobox-header-aria-label
Open

fix(z-combobox): add aria-label to header for selected filter count (WCAG 2.4.6)#662
ada-workbackai wants to merge 1 commit intomasterfrom
workbackai/fix/wcag-2.4.6-combobox-header-aria-label

Conversation

@ada-workbackai
Copy link
Copy Markdown
Contributor

Summary

Fixes WCAG 2.4.6 (Headings and Labels) by moving the descriptive aria-label from an inner <span> (which has no semantic role) to the header <div> (which has role="combobox" or role="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-label on the inner span is not used by assistive technology for the button's accessible name.

Solution: The header <div> now receives aria-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

  • All 15 z-combobox unit tests pass
  • Full test suite passes (69 suites, 334 tests)
  • Build completes successfully (yarn build)
  • Verified on production that the issue exists (header div has no aria-label)
  • Verify screen reader announces "Materia: 1 elemento selezionato" after filter selection

Evidence

View before/after screenshots and full audit details:
https://app.workback.ai/issues/xs9rtj7krbbgyffhmp3vuymgbg/


WCAG Reference:
2.4.6 Headings and Labels

…(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.
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.

1 participant