fredolss/rater-js

Has rater-js been optimized/tested for touch/smart devices?

Closed this issue ยท 10 comments

Has rater-js been optimized/tested for touch/smart devices?

Hi,

If you mean if supports touch events, then no, but I have plans for this.

+1, for some reason I have to double-tap on iOS Safari for the callback to fire :(

Reason: https://css-tricks.com/annoying-mobile-double-tap-link-issue/

+1, for some reason I have to double-tap on iOS Safari for the callback to fire :(

Reason: https://css-tricks.com/annoying-mobile-double-tap-link-issue/

Actually, I like it since you can use ratingText to warn the user.

+1, for some reason I have to double-tap on iOS Safari for the callback to fire :(
Reason: https://css-tricks.com/annoying-mobile-double-tap-link-issue/

Actually, I like it since you can use ratingText to warn the user.

Can you explain the double-tap issue on iOS Safari, @luiscastro193 ?
I hope this is not a show stopper for me because a lot of people use iOS Safari.

Fist tap fills the stars and triggers ratingText but the callback isn't fired until the second callback. So users will think the rating is already done when actually it isn't, unless you warn them with ratingText.

I will update to use title attribute instead. This will solve these problems I think.

@fredolss Thanks for putting together this script. Have you been able to make changes for mobile use? When I try it on your demo and my test site I get the following error in the browser console.

Uncaught TypeError: this.setRating is not a function

Same problem here, on mobile seems doesn't work anymore

Commenting the following lines fixes the issue for me:

	elem.addEventListener("touchmove", handleMove, false);
	elem.addEventListener("touchstart", handleStart, false);
	elem.addEventListener("touchend", handleEnd, false);
	elem.addEventListener("touchcancel", handleCancel, false);

So obviously the touch events are breaking it.

Sorry for the delay. Now it's fixed.