Repository navigation
[ButtonGroup] Fix variant outlined always has primary color borders on hover - #29487
Merged
ZeeshanTamboli merged 3 commits intoNov 4, 2021
Merged
ZeeshanTamboli merged 3 commits into
ZeeshanTamboli merged 3 commits into
Conversation
ZeeshanTamboli
marked this pull request as ready for review
November 3, 2021 13:41
…t be in last element (:not(:last-of-type))
mnajdova
reviewed
Nov 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #29219
The border-color style is applied in the
Buttoncomponent and we don't need to have it inButtonGroup. Since the hovering behaviour is such that it is not on the complete ButtonGroup but instead on individual buttons within button group.Since in
ButtonGrouptheborder-right-colorandborder-bottom-colorforhorizontalandverticalorientation respectively istransparent, while hovering we take the current color value.I think this is a regression from
v5.0.0-alpha.25from PR #24775.In v4, we had border color styles while hovering on both
ButtonGroupandButtonbut theButtonones had high specificity. In v5, with the new styling solution, thegroupedselector withinroot($ .grouped) inButtonGroupgot the high specificity. But anyway I think we need not have border color styles inButtonGroup.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