From 7c729555e5ecf5639d16fccec3bd9bbd319e32ac Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 12 Jun 2013 17:56:58 -0700 Subject: [PATCH] improve highlighting in single selects --- select2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index cc528175..b851b650 100644 --- a/select2.js +++ b/select2.js @@ -2133,7 +2133,11 @@ the specific language governing permissions and limitations under the Apache Lic // and highlight it if (noHighlightUpdate !== false) { - this.highlight(selected); + if (initial === true && selected >= 0) { + this.highlight(selected); + } else { + this.highlight(0); + } } // hide the search box if this is the first we got the results and there are enough of them for search