Skip to content

fix(DataViewFilters): add accessible name to filter category toggle - #687

Open
aloktomarr wants to merge 1 commit into
patternfly:mainfrom
aloktomarr:fix/data-view-filters-toggle-accessible-name-680
Open

fix(DataViewFilters): add accessible name to filter category toggle#687
aloktomarr wants to merge 1 commit into
patternfly:mainfrom
aloktomarr:fix/data-view-filters-toggle-accessible-name-680

Conversation

@aloktomarr

Copy link
Copy Markdown

The DataViewFilters category-selector MenuToggle renders only an icon plus activeAttributeMenu, which starts empty and is populated after the first render. Screen readers therefore saw an unnamed button — a critical axe button-name violation (WCAG 4.1.2).

This adds a fallback aria-label ("Filter by") to the toggle and initializes the active category synchronously from the first filter's title so the control is never empty. Includes a regression test asserting the toggle has an accessible name.
One note for review: the static aria-label becomes the accessible name (over the visible category text). Happy to switch to a dynamic Filter by {category} if you'd prefer the name to include the active category (WCAG 2.5.3).
Fixes #680

The category-selector MenuToggle rendered only an icon plus activeAttributeMenu, which starts empty and is populated after first render, so screen readers saw an unnamed button (critical axe button-name violation, WCAG 4.1.2).

Add a fallback aria-label to the toggle and initialize the active category synchronously from the first filter's title so the control is never empty. Includes a regression test.

Fixes patternfly#680
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.

DataViewFilters: MenuToggle for filter category selector has no accessible name

1 participant