Skip to content
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

[Radio]: inputProps no longer being applied after introduction of slotProps #45447

Open
kgregory opened this issue Feb 28, 2025 · 1 comment · May be fixed by #45471
Open

[Radio]: inputProps no longer being applied after introduction of slotProps #45447

kgregory opened this issue Feb 28, 2025 · 1 comment · May be fixed by #45471
Assignees
Labels
component: radio This is the name of the generic UI component, not the React module! regression A bug, but worse

Comments

@kgregory
Copy link
Member

kgregory commented Feb 28, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: MUI Standalone Radio Button Demo
  2. Observe that aria-label is applied via inputProps, but the radio's input has no accessible name
  3. Change the dependency to 6.4.5
  4. Observe that aria-label is applied via inputProps, but the radio's input has an accessible name

Current behavior

6.4.6 introduced a bug that can be seen in the Standalone Radio Buttons demo: inputProps are no longer being applied:

      <Radio
        checked={selectedValue === 'a'}
        onChange={handleChange}
        value="a"
        name="radio-buttons"
        inputProps={{ 'aria-label': 'A' }}
      />

The radio button no longer has an accessible name. The user needs to use slotProps.input, but that is a breaking change.

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  System:
    OS: Windows 11 10.0.26100
  Binaries:
    Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.10.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Chromium (133.0.3065.82)
  npmPackages:
    typescript: 5.7.3 => 5.7.3

Search keywords: Radio, slotProps

@kgregory kgregory added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 28, 2025
@kgregory
Copy link
Member Author

kgregory commented Feb 28, 2025

Worth noting that this issue is not present in Checkbox and similar treatment for Radio is likely to fix the issue.

@siriwatknp siriwatknp linked a pull request Mar 3, 2025 that will close this issue
1 task
@siriwatknp siriwatknp added component: radio This is the name of the generic UI component, not the React module! regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 3, 2025
@DiegoAndai DiegoAndai moved this to Selected in Material UI Mar 3, 2025
@DiegoAndai DiegoAndai moved this from Selected to In progress in Material UI Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: radio This is the name of the generic UI component, not the React module! regression A bug, but worse
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants