From 1e2881d5d1628d48d821aa7aef6f292a903dc198 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 18 Jun 2012 20:44:26 -0700 Subject: [PATCH] a small optimization to how many times highlight is called --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 56c42c3a..be95a904 100755 --- a/select2.js +++ b/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)); }