Open jamesl1001 opened 3 years ago
Ok, i see. I would not make any changes on the onChange
function, and instead, we could have a function onClick
that you can use it. I'm gonna try to do it as soon as I have some free time. Otherwise, feel free to add it and create PR for it.
If a user selects 3/5, then clicks 3/5 again, with only
onChange
there is no way for the event to be triggered again.For more context, in my case, I have a model which opens when the user clicks on any star. That modal can then be dismissed. The state of the original stars remains the same. If the user clicks the same star again, nothing happens because the rating is not changing. The modal will only appear again if the user changes their rating.