-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[joy] Fix persisting hover state styles on click on mobile #36704
Conversation
Co-authored-by: seunexplicit <48022904+seunexplicit@users.noreply.github.com>
Netlify deploy previewhttps://deploy-preview-36704--material-ui.netlify.app/ Bundle size report |
@oliviertassinari this PR is ready for review |
What's the verdict on this? @siriwatknp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for the fix. I'm so sorry to keep you waiting, lost track of it.
{ '&:hover': theme.variants[`${ownerState.variant!}Hover`]?.[ownerState.color!] }, | ||
{ | ||
'&:hover': { | ||
'@media (hover: hover)': theme.variants[`${ownerState.variant!}Hover`]?.[ownerState.color!], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Material UI, I don't recall why we used the opposite: #15000 (comment). It might have been because of IE 11 support https://caniuse.com/mdn-css_at-rules_media_hover which is no longer relevant. I think that it could be good to normalize on what works best between Joy UI and Material UI. I guess that the approach we use here has the advantage of being clearer to override. cc @DiegoAndai
At first sight, this in Joy UI looks better than in Material UI, e.g. for customization, it's more straightforward:

Fixes button retaining hover effect on mobile devices.
One iteration on #36583
Preview: https://deploy-preview-36704--material-ui.netlify.app/joy-ui/react-button/
This code was written and reviewed by GitStart Community. Growing great engineers, one PR at a time.