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] Fix variant outlined always has primary color borders on hover #29487

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Nov 3, 2021

Fixes #29219

The border-color style is applied in the Button component and we don't need to have it in ButtonGroup. Since the hovering behaviour is such that it is not on the complete ButtonGroup but instead on individual buttons within button group.

Since in ButtonGroup the border-right-color and border-bottom-color for horizontal and vertical orientation respectively is transparent, while hovering we take the current color value.

I think this is a regression from v5.0.0-alpha.25 from PR #24775.

In v4, we had border color styles while hovering on both ButtonGroup and Button but the Button ones had high specificity. In v5, with the new styling solution, the grouped selector within root ($ .grouped) in ButtonGroup got the high specificity. But anyway I think we need not have border color styles in ButtonGroup.


Before v5.0.0-alpha.25 : https://codesandbox.io/s/mui-buttongroup-color-bug-forked-xw8ke?file=/src/Demo.tsx (in v5.0.0-alpha.24)

Before fix: https://codesandbox.io/s/mui-buttongroup-color-bug-t37rv?file=/src/Demo.tsx
After fix: https://codesandbox.io/s/mui-buttongroup-color-bug-63351?file=/src/Demo.tsx

@ZeeshanTamboli ZeeshanTamboli changed the title [ButtonGroup] Fix variant outlined border color on hover [ButtonGroup] Fix variant outlined always has primary color borders on hover Nov 3, 2021
@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work component: ButtonGroup The React component. labels Nov 3, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 3, 2021

Details of bundle changes

Generated by 🚫 dangerJS against c01fd13

@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review November 3, 2021 13:41
Copy link
Member

@mnajdova mnajdova 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 👌

@ZeeshanTamboli ZeeshanTamboli merged commit b845d34 into mui:master Nov 4, 2021
@ZeeshanTamboli ZeeshanTamboli deleted the issue-29219-buttongroup-border-on-hover branch November 4, 2021 10:58
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 variant outlined always has primary color borders on hover
3 participants