admin管理员组

文章数量:1289352

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.

Example Markup

<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>

Example jQuery

$('select').on('change', function() {
  alert('Changed!');
});

Is this a bug with Chrome? I've tried searching but haven't e across anything.

Here's a fiddle

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.

Example Markup

<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>

Example jQuery

$('select').on('change', function() {
  alert('Changed!');
});

Is this a bug with Chrome? I've tried searching but haven't e across anything.

Here's a fiddle

Share Improve this question edited Jun 4, 2013 at 7:05 billyonecan asked Jun 3, 2013 at 15:19 billyonecanbillyonecan 20.3k9 gold badges44 silver badges65 bronze badges 8
  • I can't replicate it in Chrome (also v27) – dsgriffin Commented Jun 3, 2013 at 15:22
  • @Zenith really? I'm using v27.0.1453.94m (apparently the latest version) and Windows 7 (though I didn't think the OS would be applicable) – billyonecan Commented Jun 3, 2013 at 15:24
  • @billyonecan I'm exactly the same version and on Windows 7 too :/ weird – dsgriffin Commented Jun 3, 2013 at 15:25
  • @Zenith that's very strange indeed :| – billyonecan Commented Jun 3, 2013 at 15:25
  • @billyonecan i am using Version 27.0.1453.94 m with Windows7 can't replicate either. But seems to be a bug looking at PSR answer. – PSL Commented Jun 3, 2013 at 15:26
 |  Show 3 more ments

1 Answer 1

Reset to default 12

It is the bug in chrome

SELECT box with MULTIPLE option fires ONCHANGE event on scroll

and here

本文标签: javascriptChrome Scroll on ltselectgt triggers change() eventStack Overflow