The partial star selection, returning a decimal number, is clever, but this is an exotic use-case, and most people want to have 5 stars and get an integer from 1 to 5 (and never allow zero to be a choice). (This is how reviews at Amazon et al work.)
There seems to be no combination of the configuration options to allow this, however.
My first workaround was to use all the defaults, and then in the onSet handler to do:
function handleRatingChange(rating){
rating = Math.ceil(rating);
obj.setRating(rating);
...
}
But the partial stars effect is distracting, so we just want each star to be on or off.
I've tried precision:1, but the star can only be selected by clicking in the right-hand side of it. E.g. clicking in the left hand side of the middle star calls onSet(2) not onSet(3). Clicking the left-hand side of the first star calls onSet(0).
Trying to be explicit about all settings with precision:1,min:1,max:5,count:5,minSelected:1 is weird: mouse-over the first star fills in the first star, and a bit of the second star. Mouseover the middle star fills in part of it. (This is similar to #4, I think.)
The partial star selection, returning a decimal number, is clever, but this is an exotic use-case, and most people want to have 5 stars and get an integer from 1 to 5 (and never allow zero to be a choice). (This is how reviews at Amazon et al work.)
There seems to be no combination of the configuration options to allow this, however.
My first workaround was to use all the defaults, and then in the
onSet
handler to do:But the partial stars effect is distracting, so we just want each star to be on or off.
I've tried
precision:1
, but the star can only be selected by clicking in the right-hand side of it. E.g. clicking in the left hand side of the middle star callsonSet(2)
notonSet(3)
. Clicking the left-hand side of the first star callsonSet(0)
.Trying to be explicit about all settings with
precision:1,min:1,max:5,count:5,minSelected:1
is weird: mouse-over the first star fills in the first star, and a bit of the second star. Mouseover the middle star fills in part of it. (This is similar to #4, I think.)