-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[Switch][Checkbox][Radio] Remove aria-disabled from root span
#46318
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
base: master
Are you sure you want to change the base?
Conversation
|
Hey @siriwatknp, please can you review this PR. If anything needs to be added, please let me know, I will update the PR. Thanks! |
| focusRipple: !disableFocusRipple, | ||
| disabled, | ||
| role: undefined, | ||
| role: 'switch', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the explicit role: undefined exist for specific fix.
The proper fix is to add role: 'switch' to Switch component. @sai6855 Would you mind checking on this?
This PR requires a test to ensure that the issue is fixed without introducing any regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU, SwitchBase component uses ButtonBase as the root component, which automatically assigns role=button to Switch. So, to override that, we explicitly provide role=undefined as a prop.
But in our case, we want the role to be switch. So, I feel that updating SwitchBase role to switch is the right approach. But, it's just my thought process and I can be wrong.
Netlify deploy previewhttps://deploy-preview-46318--material-ui.netlify.app/ Bundle size report
|
aria-disabled from root span
aria-disabled from root spanaria-disabled from root span
|
@KirankumarAmbati @siriwatknp Let's keep this PR focused on In this PR, I removed The |
|
@siriwatknp Can you review this? See #46318 (comment). |
Fixes #45436
Checkbox: https://deploy-preview-46318--material-ui.netlify.app/material-ui/react-checkbox/
Switch: https://deploy-preview-46318--material-ui.netlify.app/material-ui/react-switch/
Radio: https://deploy-preview-46318--material-ui.netlify.app/material-ui/react-radio-button/#direction