Skip to content

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

Closed
@kgregory

Description

@kgregory

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

Metadata

Metadata

Assignees

Labels

component: radioThis is the name of the generic UI component, not the React module!regression 🐛A bug, but worse

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions