Open the axe-devtools extension and run a full scan of the page
Observe the accessibility error: "Ensures an element's role supports its ARIA attributes"
Sample code that illustrates the problem
While aria-checked="mixed" would be useful in a sp-swatch-group where the role of the sp-swatch would be checkbox, in a single sp-swatch which surfaces the role=button, the use of aria-checked is invalid.
The "mixed" state should be part of the aria-label in this case.
Code of conduct
Impacted component(s)
sp-swatch
Expected behavior
No accessibility warnings should be thrown
Actual behavior
Issue was observed in Express, but it is reproducing on Spectrum Web Components documentation as well: https://opensource.adobe.com/spectrum-web-components/components/swatch/
Screenshots
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
Sample code that illustrates the problem
While
aria-checked="mixed"
would be useful in asp-swatch-group
where the role of thesp-swatch
would becheckbox
, in a singlesp-swatch
which surfaces therole=button
, the use of aria-checked is invalid. The "mixed" state should be part of the aria-label in this case.Logs taken while reproducing problem
No response