Explorar o código

a small optimization to how many times highlight is called

Igor Vaynberg %!s(int64=13) %!d(string=hai) anos
pai
achega
1e2881d5d1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -785,7 +785,7 @@
 
         highlightUnderEvent: function (event) {
             var el = $(event.target).closest(".select2-result");            
-            if (el.length > 0) {
+            if (el.length > 0 && !el.is(".select2-highlighted")) {
         		var choices = this.results.find('.select2-result');
                 this.highlight(choices.index(el));
             }