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

[ButtonGroup] Should not retain divider color when it is disabled and variant is text #36967

Merged
merged 5 commits into from Apr 28, 2023

Conversation

DavidBoyer11
Copy link
Contributor

@DavidBoyer11 DavidBoyer11 commented Apr 23, 2023

Fixes #36735

@mui-bot
Copy link

mui-bot commented Apr 23, 2023

Netlify deploy preview

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

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against cfa9081

@DavidBoyer11 DavidBoyer11 changed the title FixedDisabled Fixed Disabled ButtonGroup when variant is text Apr 23, 2023
@zannager zannager added the component: ButtonGroup The React component. label Apr 24, 2023
@ZeeshanTamboli ZeeshanTamboli added the bug 🐛 Something doesn't work label Apr 25, 2023
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

We need to apply a disabled border color using the disabled class as shown below instead of not applying a border color at all.

...(ownerState.variant === 'contained' &&
ownerState.orientation === 'horizontal' && {
borderRight: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
[`&.${buttonGroupClasses.disabled}`]: {
borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`,
},
}),
...(ownerState.variant === 'contained' &&
ownerState.orientation === 'vertical' && {
borderBottom: `1px solid ${(theme.vars || theme).palette.grey[400]}`,
[`&.${buttonGroupClasses.disabled}`]: {
borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`,
},
}),

The above code snippet is for the contained variant. The same is to be applied for the text variant for both horizontal and vertical orientations.

Also please add visual regression test. You can follow the README instructions on how to add it.

@ZeeshanTamboli ZeeshanTamboli added the PR: needs test The pull request can't be merged label Apr 25, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title Fixed Disabled ButtonGroup when variant is text [ButtonGroup] Should not retain divider color when disabled and variant="text" Apr 25, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title [ButtonGroup] Should not retain divider color when disabled and variant="text" [ButtonGroup] Should not retain divider color when it is disabled and variant is text Apr 25, 2023
@ZeeshanTamboli ZeeshanTamboli removed the PR: needs test The pull request can't be merged label Apr 28, 2023
@ZeeshanTamboli ZeeshanTamboli dismissed their stale review April 28, 2023 10:58

Changes addressed

Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

I pushed the remaining changes because the issue is opened from a long time. @DavidBoyer11 Thanks for the PR.

@ZeeshanTamboli ZeeshanTamboli merged commit a050aab into mui:master Apr 28, 2023
19 checks passed
binh1298 pushed a commit to binh1298/material-ui that referenced this pull request May 17, 2023
… variant is `text` (mui#36967)

Co-authored-by: FeCurtain <david_boyer@mac.com>
Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
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: ButtonGroup The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ButtonGroup retains divider color when disabled and variant="text"
4 participants