Repository navigation
[ButtonGroup] Prevent sticky hover border on touch devices - #48993
Merged
Merged
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
silviuaavram
approved these changes
Aug 19, 2026
silviuaavram
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you for the contribution!
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.
Closes #48992
Summary
On touch devices, tapping a button inside an
ButtonGroupwithvariant="outlined"leaves its right border (horizontal) or bottom border (vertical) permanently darkened, until another element is tapped.ButtonGrouprestores the divider border on hover:material-ui/packages/mui-material/src/ButtonGroup/ButtonGroup.js
Lines 169 to 174 in 0e0c935
Buttonalready guards all of its own hover styles behind@media (hover: hover):material-ui/packages/mui-material/src/Button/Button.js
Lines 177 to 179 in 0e0c935
(So the sticky tap-hover is currently not applied to a
Buttonat all.)This PR applies the same
@media (hover: hover)guard toButtonGroup.Technical detail
The
ButtonGrouphas a&:hoverspecification, which cancels theborderRightColor: 'transparent'(orborderBottomColorfor vertical orientation). The rest of hover style is done in theButton.Buttondoes not do any hover for touch deviceButtonGroupstill cancels the transparation of right/bottom borderScope
Only the
outlinedvariant has a border with ahoverrule.The remaining
&:hoverinmaterial-ui/packages/mui-material/src/ButtonGroup/ButtonGroup.js
Lines 75 to 77 in 0e0c935