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

[material-ui][RadioGroup] Apply classnames #41610

Merged

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Mar 23, 2024

Fixes #41076

Preview: https://deploy-preview-41610--material-ui.netlify.app/material-ui/react-radio-button/

Rather than modifying the radio group classnames in the API documentation, I think the correct fix is to apply those classnames to the Radio Group component. The API documentation for Radio button CSS classes is correct.

Having both MuiFormGroup and MuiRadioGroup classes might not seem ideal, but it's consistent with other components like the Outlined Input, which has both MuiOutlinedInput and MuiInputBase related classnames. However, this does lead to an increase in bundle size.

If we decide to retain only the radio group related classes, two things need consideration:

  • Removing form group related classnames would constitute a breaking change, which might be acceptable for version 6.
  • We'd need to separate the Radio Group from Form Group. Although it's implementation would largely remain the same as Form Group, Radio Group wouldn't inherit from Form Group.

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work component: radio This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Mar 23, 2024
@mui-bot
Copy link

mui-bot commented Mar 23, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 1f6b0ba

@ZeeshanTamboli ZeeshanTamboli changed the title [material-ui][RadioGroup] Add classnames [material-ui][RadioGroup] Apply classnames Mar 23, 2024
@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review March 23, 2024 09:22
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏼

I wouldn't remove the FormGroup classes unless there's an issue with them. I don't think they bloat the component too much. We could open an issue to discuss it if you feel like it's necessary, but as you mention, it would have to remain consistent with other components.

@ZeeshanTamboli
Copy link
Member Author

I also included tests.

I wouldn't remove the FormGroup classes unless there's an issue with them. I don't think they bloat the component too much. We could open an issue to discuss it if you feel like it's necessary, but as you mention, it would have to remain consistent with other components.

Alright, I am fine if it needs to be consistent.

@ZeeshanTamboli ZeeshanTamboli merged commit e85839f into mui:next Mar 27, 2024
18 of 19 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the issue-41076-radio-group-classnames branch March 27, 2024 07:02
ZeeshanTamboli added a commit to ZeeshanTamboli/material-ui that referenced this pull request Mar 27, 2024
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Mar 29, 2024
tejasparkar pushed a commit to tejasparkar/material-ui that referenced this pull request Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: radio This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui][Radio Group] Classnames on the API page are incorrect
3 participants