-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Rating] Component hover state gets stuck #18939
Comments
Please provide a CodeSandbox example that reproduces the problem (you can start with a docs demo); and ideally identify why you think it is a problem with the component. |
Reproduction: https://codesandbox.io/s/material-demo-cek44 It occurs only with emptyIcon={ Might be related to this: |
I can confirm that the following works for me:
|
The Rating component depends on I may suggest to add |
Hum, I wonder if we don't have a performance issue that originates on this problem, however, the pointer event proposal seems to fix the problem :). diff --git a/packages/material-ui-lab/src/Rating/Rating.js b/packages/material-ui-lab/src/Rating/Rating.js
index d454c2481e..a5108473f6 100644
--- a/packages/material-ui-lab/src/Rating/Rating.js
+++ b/packages/material-ui-lab/src/Rating/Rating.js
@@ -92,6 +92,9 @@ export const styles = theme => ({
transition: theme.transitions.create('transform', {
duration: theme.transitions.duration.shortest,
}),
+ // Fix mouseLeave issue.
+ // https://github.com/facebook/react/issues/4492
+ pointerEvents: 'none',
},
/* Styles applied to the icon wrapping elements when empty. */
iconEmpty: { Does anyone want to work on a pull request? :) |
I'll do the pull request |
Current Behavior 😯
Multiple Star components are rendered on-screen. Hovering without clicking seems to make some of them stay highlighted.
Expected Behavior 🤔
Should not be filled in unless clicked.
Steps to Reproduce 🕹
Context 🔦
Just trying to give people a way to leave ratings..
Your Environment 🌎
I'm using them in a dialog.
The text was updated successfully, but these errors were encountered: