Skip to content

Add aria-label to filter panel close button - #2858

Open
olitreadwell wants to merge 1 commit into
hackforla:developfrom
olitreadwell:fix/aria_label_filter_panel_close_button
Open

Add aria-label to filter panel close button#2858
olitreadwell wants to merge 1 commit into
hackforla:developfrom
olitreadwell:fix/aria_label_filter_panel_close_button

Conversation

@olitreadwell

Copy link
Copy Markdown

What changed

Add aria-label="Close filters" to the desktop close button (icon-only IconButton) in the search results filter panel.

Add a Playwright test that verifies the button is reachable by its accessible name and closes the panel.

Why

The button at FilterPanel.tsx:155 rendered only a <CloseIcon /> with no text and no aria-label, so its accessible name was empty. A screen reader announced it just as "button", giving no hint of its purpose.

The fix follows the file's own convention: the sibling clear-filter button already uses aria-label="Clear organization name filter", and AnnouncementSnackbar uses aria-label="close".

Verified empirically: with the source fix reverted, the new test fails (getByRole("button", { name: "Close filters" }) finds nothing); with the fix, it passes.

How to verify

cd client
npm ci
npx playwright install chromium
npm run start &                       # vite dev server on :3000
npx wait-on http://localhost:3000
CI=1 npx playwright test tests/organizations.spec.ts --project=chromium

The desktop "close filters" button in the search results filter panel
was an icon-only IconButton with no accessible name. A screen reader
announced it only as "button", so users could not tell what it does.

Add aria-label="Close filters", matching the pattern already used by the
sibling "Clear organization name filter" button in the same file and the
"close" button in AnnouncementSnackbar.

Also add a Playwright test that opens the filter panel, asserts the close
button is reachable by its accessible name, and confirms it closes the panel.
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