-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed as not planned
Labels
component: radioThis is the name of the generic UI component, not the React module!This is the name of the generic UI component, not the React module!
Description
Steps to reproduce
Steps:
- Open this link to live example: https://stackblitz.com/edit/tsnr9qpf?file=src%2FDemo.tsx
- Check the console
Current behavior
The event of Radio onClick is typed as MouseEvent<HTMLButtonElement, MouseEvent>, but the target seems to always be an HTMLInputElement as you can see in the image below

This is a problem because HTMLButtonElement doesn't have the 'value' attribute, so you can't access the value set to the radio button. I think this is because Radio inherit ButtonBase props.
Expected behavior
onClick should be typed as MouseEvent<HTMLInputElement, MouseEvent>
Context
No response
Your environment
npx @mui/envinfo
System:
OS: Linux 5.0 undefined
Binaries:
Node: 20.19.1 - /usr/local/bin/node
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
Browsers:
Chrome: Not Found
Search keywords: radio, event, target, onclick
Metadata
Metadata
Assignees
Labels
component: radioThis is the name of the generic UI component, not the React module!This is the name of the generic UI component, not the React module!