ui-ninja / react-native-rating-element

A simple rating library for react native supporting: decimal points, direction aware icons, custom icon set from Ionicons, custom images and record rating given by users.
MIT License
25 stars 5 forks source link

onIconTap should fire even if readonly is true #9

Closed Relax594 closed 4 years ago

Relax594 commented 4 years ago

I know it's by design, but why? I don't see any reason for it. Even if the Rating is readonly, i want to know where a user tapped (to toggle tooltips in my case).

https://github.com/ui-ninja/react-native-rating-element/blob/eafbde201a1dc06c9b2e3c3a6d79403b7049b45d/src/Rating/components/IconBar.js#L31

If you want to keep it this way, at least note it in the docs.

Regards

ui-ninja commented 4 years ago

I don't think it will make sense to trigger onIconTap if readonly is passed. For your usecase, simply don't make it readonly..

If you want to keep it this way, at least note it in the docs.

I mentioned it under API table's row readonly that onPress wont be fired.. But I forgot to update it once I changed onPress to onIconTap. Will update soon in new minor version. Anyway i have plans to make few changes in IconBar.

Relax594 commented 4 years ago

For your usecase, simply don't make it readonly..

haha honestly, i never thought about this :100:

Thanks a lot!