eschutho opened a new pull request, #41742:
URL: https://github.com/apache/superset/pull/41742
### WCAG rule
WCAG 2.1 SC 4.1.2 — Level A (Name, Role, Value).
### What changed
Two icon-only controls in the native filters config modal
(`FilterTitleContainer.tsx`'s "remove filter" icon and
`ItemTitleContainer.tsx`'s "remove item" icon, both `Icons.DeleteOutlined`)
were passing an `alt` prop to try to give them a contextual accessible name.
`alt` isn't a recognized prop on these `Icons.*` components (built on the
shared `BaseIcon`) — it's just spread onto the DOM as an inert attribute — so
screen readers fell back to `BaseIcon`'s generic auto-generated label
("delete") instead of the intended "Remove filter" / "Remove item" text.
Swapped `alt=` for `aria-label=` at both call sites, which does take effect
(confirmed via `BaseIcon.tsx`'s prop-spread order for this icon type).
A third call site (`DraggableFilter.tsx`, `Icons.Drag`) had the same `alt`
bug, but that icon renders through `BaseIcon`'s `customIcons` branch, which has
a *different*, pre-existing issue: caller props are spread onto the inner SVG
rather than the outer `role`-bearing `<span>`, so an `aria-label` override
there doesn't reach the accessible element either way. Left that one alone
rather than papering over it — it needs a fix in `BaseIcon.tsx` itself, which
affects many more call sites and is out of scope for this small fix.
Also updated `FilterConfigPane.test.tsx`'s "remove filter" test, which
queried the DOM by the old `[alt=...]` attribute selector, to query by
`[aria-label=...]` instead.
### Behavior
No visual or functional change — same click handlers, same icons, same test
coverage. Only the accessible name computation changes.
### Test plan
- [x] `npx jest
src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigPane.test.tsx`
— 5/5 passing
- [ ] Manual: open a dashboard's native filters config modal, tab to a
filter's "remove" (trash) icon with a screen reader running, verify it
announces "Remove filter" (not "delete")
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]