-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Switch] disabled
prop doesn't set aria-disabled
on input element
#45436
Comments
disabled
prop doesn't set aria-disabled
on input element
@DavidIvanov Thanks for reporting this ~ For now you can manually set <Switch
disabled
inputProps={{
"aria-label": "My Switch",
"aria-disabled": true,
}}
/> https://codesandbox.io/p/sandbox/divine-feather-sp5lkq?file=%2Fsrc%2FApp.js%3A11%2C9-17%2C11 |
Added the Please reach out in this thread if you're interested ~ |
Hi! I would like to work on this issue. |
@dinesjo Thanks ~ I've assigned you |
@mj12albert Here's an update on this: I'm currently working on this as part of a university course on software engineering along with 2 others. In the following days we can find a way to systematically add this attribute to all such inputs and open a PR including unit tests once we are ready. |
@DavidIvanov @mj12albert I believe that the solution to this issue is to reconsider the Based on MDN, the I see two ways:
After checked with Base UI Switch, using |
Steps to reproduce
Add an MUI Switch to your document and give it the disabled prop.
Current behavior
Currently the aria-disabled is set on the span surrounding the input instead of on the input directly.
This causes accessibility issues with this rule
https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions
Expected behavior
The aria-disabled prop should be on the input directly.
Context
I want to be accessibility compliant with WCAG 2.1
Your environment
npx @mui/envinfo
Search keywords: Switch, aria-disabled, Accessibility
The text was updated successfully, but these errors were encountered: