dreyescat / bootstrap-rating

Bootstrap Rating is a jQuery plugin that creates a rating control that uses Bootstrap glyphicons for rating symbols.
http://dreyescat.github.io/bootstrap-rating/
MIT License
192 stars 78 forks source link

onchange is triggered twice #36

Open yourchoice opened 6 years ago

yourchoice commented 6 years ago

This is triggered twice, because already exists in plugin

$('input').on('change', function () { alert('Rating: ' + $(this).val()); });

dreyescat commented 6 years ago

Hi @yourchoice! I'm not sure what you mean...

Do you mean that the change event is triggered twice when? Right now it should be triggered whenever you click on a symbol, but once for click. Check this jsfiddle.

yourchoice commented 2 years ago

that happen just on mobile

I think problem commes form here 'mousedown touchstart' ... both events are fired ....

an e.preventDefault(); fix it