Selaa lähdekoodia

improve whitespace detection

Igor Vaynberg 13 vuotta sitten
vanhempi
commit
9c4a4d1b8a
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -476,7 +476,7 @@
 
             installKeyUpChangeEvent(search);
             search.bind("keyup-change", this.bind(this.updateResults));
-            search.bind("focus", function () { search.addClass("select2-focused"); search.val(""); });
+            search.bind("focus", function () { search.addClass("select2-focused"); if (search.val() === " ") search.val(""); });
             search.bind("blur", function () { search.removeClass("select2-focused");});
 
             this.dropdown.delegate(resultsSelector, "click", this.bind(function (e) {