Преглед на файлове

improve highlighting in single selects

Igor Vaynberg преди 12 години
родител
ревизия
7c729555e5
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      select2.js

+ 5 - 1
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