-
-
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] Fix Rating returns NaN when using user event #45054
base: master
Are you sure you want to change the base?
Conversation
cdf633e
to
b7804d9
Compare
if (Number.isNaN(newHover)) { | ||
// Workaround for test scenario using userEvent since jsdom defaults getBoundingClientRect to 0 | ||
// Fix https://github.com/mui/material-ui/issues/38828 | ||
newHover = -1; | ||
} | ||
|
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.
Does it make more sense to return
if Number.isNaN(newHover)
is true?
if (Number.isNaN(newHover)) {
return;
}
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.
Then move the setFocusVisible(false)
up before the condition so it always run.
Netlify deploy previewhttps://deploy-preview-45054--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
Closes #38828