material-web
material-web copied to clipboard
Cannot label progress and other accessibility issues
Describe the bug
The mwc-linear-progress and mwc-circular-progress components provide no way to give the element with role="progressbar" an accessible name through their APIs. There are also several other ARIA attributes not supported. Furthermore, omitting both the progress and indeterminate properties in the API does not result in something accessible.
I would recommend the following changes:
- Provide a property to set
aria-labeland/oraria-labeledby - Provide a way to set
aria-describedby - Get rid of the
indeterminateproperty and just allow theprogressproperty to have typestring | number | null. Then:
| progress type | Render as |
|---|---|
| number | aria-valuenow="number" |
| string | aria-valuetext="string" |
| null or "" | Treat as indeterminate and omit both aria-valuenow and aria-valuetext |
To Reproduce n/a
Expected behavior Component API should, at a minimum, support all required ARIA states and properties for the progress bar role, and should render something accessible when API properties are omitted.
Screenshots
Browser Version (please complete the following information): n/a
Additional context ARIA 1.2 Progress bar role
Getting ready to patch this downstream because it's taking too long to address, and noticed today that the progress components do support aria-label but it's not documented. 👎
Fixed in M3, all components support ARIA accessibility features