I have a <select>
element with the multiple="multiple"
attribute. In Chrome (v27), the change()
event is getting triggered when the user scrolls by clicking and dragging using the mouse. Once a value has been selected, the problem ceases to exist.
<select multiple="multiple">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
$('select').on('change', function() {
alert('Changed!');
});
Is this a bug with Chrome? I've tried searching but haven't come across anything.
You could write a simple throttle debounce function to limit the times per second the scroll event will be handled. function debounce(method, delay) { clearTimeout(method. _tId); method. _tId= setTimeout(function(){ method(); }, delay); } $(window).
It is the bug in chrome
SELECT box with MULTIPLE option fires ONCHANGE event on scroll
and here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With