andrucz / ionic2-rating

:star: Angular star rating bar. Built for Ionic 2+.
MIT License
178 stars 62 forks source link

How a user give half star rating #38

Open thomaspessato opened 6 years ago

thomaspessato commented 6 years ago

First of all, let me say thank you for this very nice component!

Is there a way I can tap on a star and, according to the place, gives a half star rating?

In my case, I want to have a 1-10 range, but only 5 stars...

Thanks for your attention!

andrucz commented 6 years ago

Hey, @thomaspessato. I am glad to hear that this component was helpful.

Unfortunately, there is no way to know exactly where the user clicked. The only event fired is related to the selected value. There is actually a way you can make the component select a half star, though.

Take a look at #36 and its comments. It is possible to listen to change events and when the user clicks on the same star, you can subtract 0.5 from the ngModel value.

thomaspessato commented 6 years ago

Thanks for clarifying! I'll take a look at #36, thanks!

andrucz commented 6 years ago

I will keep this issue open and see if it is possible to fire a more detailed event, including some information about click position, etc.

thomaspessato commented 6 years ago

Maybe ionic gestures could be useful here

dfliess commented 6 years ago

+1