material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Switch][Checkbox][Radio] Remove `aria-disabled` from root span

Open KirankumarAmbati opened this issue 7 months ago • 4 comments

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

KirankumarAmbati avatar Jun 11 '25 16:06 KirankumarAmbati

Hey @siriwatknp, please can you review this PR. If anything needs to be added, please let me know, I will update the PR. Thanks!

KirankumarAmbati avatar Jun 17 '25 06:06 KirankumarAmbati

Netlify deploy preview

https://deploy-preview-46318--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-11B(0.00%) ▼-2B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against bc89849798b51e93dbccf66b75af7e6796de3ce9

mui-bot avatar Jul 03 '25 09:07 mui-bot

@KirankumarAmbati @siriwatknp Let's keep this PR focused on aria-disabled. The role="switch" discussion can happen separately. Also, role="switch" should be added on the <input> so we can keep the discussions separate.

In this PR, I removed aria-disabled from the root <span> of the Switch, Checkbox, and Radio components. Since SwitchBase is shared, this affects all three. As per my research, it's correct to remove it because aria-disabled has no effect on elements without a valid ARIA role.

The role="switch" issue is already tracked in #23216, and I’ve opened a PR for it: #46482.

ZeeshanTamboli avatar Jul 03 '25 14:07 ZeeshanTamboli

@siriwatknp Can you review this? See https://github.com/mui/material-ui/pull/46318#issuecomment-3032557137.

ZeeshanTamboli avatar Nov 07 '25 06:11 ZeeshanTamboli