Skip to content
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] Half star ratings don't register events correctly on latest Chrome #32557

Closed
2 tasks done
luisrudge opened this issue May 2, 2022 · 7 comments
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: rating This is the name of the generic UI component, not the React module!

Comments

@luisrudge
Copy link
Contributor

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I can't select the 'full star' rating when enabling half star ratings:

ratings.mp4

If half stars are NOT enabled, then it works just fine:

ratings-ok.mp4

Expected behavior 🤔

I should be able to select a full star when rating precision is enabled

Steps to reproduce 🕹

Steps:

  1. Go to the website with latest chrome
  2. Try to rate any 'full star'

Context 🔦

No response

Your environment 🌎

Microsoft Edge: Version 101.0.1210.32 (Official build) (arm64)
Google Chrome: Version 101.0.4951.41 (Official Build) (arm64)

@luisrudge luisrudge added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 2, 2022
@luisrudge
Copy link
Contributor Author

I found the issue, but I'm not sure what the fix implicates, since there's a comment regarding another bug. If I remove the pointer-events: none style in here, it works as expected.

My code fix is to set a style in my icon to override that:

<Rating
  max={1}
  icon={<ClearRoundedIcon style={{ pointerEvents: "auto" }} />}
  defaultValue={0}
/>

@danilo-leal danilo-leal changed the title Half star Ratings don't register events correctly on latest Chrome [Rating] Half star ratings don't register events correctly on latest Chrome May 3, 2022
@danilo-leal danilo-leal added component: rating This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels May 3, 2022
@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 6, 2022
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented May 6, 2022

I can't select the 'full star' rating when enabling half star ratings:

I can also reproduce it in Google Chrome in Version 101.0.4951.54 (Official Build) (64-bit).
I had checked earlier and it worked before in Version 100.

It works in Firefox version 100.0

@mkhib
Copy link

mkhib commented May 6, 2022

I have the same issue. Cannot select full star in Brave browser [Version 1.38.111 Chromium: 101.0.4951.54 (Official Build) (64-bit)] if precision={0.5}.
Works in Firefox version 100.0.
Component also has problem in the MUI website MUI Rating Docs

@boutahlilsoufiane
Copy link
Contributor

Hi @ZeeshanTamboli, I will work on this!

@notsidney
Copy link
Contributor

I found the issue, but I'm not sure what the fix implicates, since there's a comment regarding another bug. If I remove the pointer-events: none style in here, it works as expected.

My code fix is to set a style in my icon to override that:

<Rating
  max={1}
  icon={<ClearRoundedIcon style={{ pointerEvents: "auto" }} />}
  defaultValue={0}
/>

And here’s a version with the sx prop so you don’t have to override the icon components:

sx={{ "& .MuiSvgIcon-root": { pointerEvents: "auto" } }}

@boutahlilsoufiane
Copy link
Contributor

Hi @ZeeshanTamboli, could you please review the PR, thanks a lot for your time!

@ZeeshanTamboli
Copy link
Member

Closing this as it works now in Google Chrome and Firefox on latest release v5.8.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: rating This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants