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

Cant reset rating from click on star #47

Open
AlexanderChiclana opened this issue Apr 27, 2023 · 3 comments · May be fixed by #60
Open

Cant reset rating from click on star #47

AlexanderChiclana opened this issue Apr 27, 2023 · 3 comments · May be fixed by #60

Comments

@AlexanderChiclana
Copy link

I am trying to build a rating system where you can reset the rating back to 0 by clicking on whatever star has already been set to the current value. For example, if a rating is showing 4 / 5 stars, clicking on the 4th star would remove the rating entirely.

I am using the initialValue prop and a controlled input as suggested,but the stars do not reset visually even though the state changes. I also built in a secondary button to test out the function and it it capable of clearing the rating.

Is there any way around this? Tried using a timeout and that didn't work

@Mizan-Rifat
Copy link

I've got the same issue. reset is not working

@quantruong
Copy link

Same issue with me

@Cpavrai Cpavrai linked a pull request Oct 21, 2024 that will close this issue
@Cpavrai
Copy link

Cpavrai commented Oct 24, 2024

As workaround, you may set initialValue to some new value on each click, which needs to be higher than iconsCount. By this trick, it sets value to 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants