smastrom / react-rating

⭐ Zero-dependency, highly customizable rating component for React.
https://reactrating.netlify.app
MIT License
346 stars 6 forks source link

MouseEvent Not Returning on onChange in Rating Component, Causing Unintended Navigation #16

Closed abdulvahidkpOctalogic closed 9 months ago

abdulvahidkpOctalogic commented 11 months ago

I'm currently facing an issue with the rating component, specifically when used within cards containing navigation links. Upon attempting to change the rating, it triggers navigation to the card's link unintentionally.

This behavior poses a usability problem, especially when the rating component is embedded within cards that are meant to serve as navigation links. The expected functionality is to change the rating without triggering navigation.

mike667 commented 10 months ago

Hello @smastrom. Unfortunately, this fix broke our functionality. Could this be as a custom option? Like enableClickPreventDefault.

Thank you.

smastrom commented 10 months ago

Hello @smastrom. Unfortunately, this fix broke our functionality. Could this be as a custom option? Like enableClickPreventDefault.

Thank you.

Which kind of functionality did it break?

mike667 commented 10 months ago

We use rating selects inside links. And we catch click events in react parent components. With this changes we need to rethink our flow, because it's not possible to configure previous behavior or set our custom click handler.

mike667 commented 9 months ago

Hello @smastrom, Is it possible to do something with it? Or I can do merge request.

But I'm not sure which approach use. I think click handler should not be blocked. If something is inside link, it should behave as a link.