Skip to content

Commit 1e2881d

Browse files
author
Igor Vaynberg
committed
a small optimization to how many times highlight is called
1 parent b2314bc commit 1e2881d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@
785785

786786
highlightUnderEvent: function (event) {
787787
var el = $(event.target).closest(".select2-result");
788-
if (el.length > 0) {
788+
if (el.length > 0 && !el.is(".select2-highlighted")) {
789789
var choices = this.results.find('.select2-result');
790790
this.highlight(choices.index(el));
791791
}

0 commit comments

Comments
 (0)