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

Merge branch 'master' of git://github.com/ivaynberg/select2

Igor Vaynberg преди 13 години
родител
ревизия
cb7f1da4e6
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      select2.js

+ 4 - 1
select2.js

@@ -352,7 +352,8 @@
             this.id=opts.id;
 
             // destroy if called on an existing component
-            if (opts.element.data("select2") !== undefined) {
+            if (opts.element.data("select2") !== undefined &&
+                opts.element.data("select2") !== null) {
                 this.destroy();
             }
 
@@ -544,6 +545,7 @@
 
             this.updateResults(true);
             this.dropdown.show();
+            this.ensureHighlightVisible();
             this.focusSearch();
         },
 
@@ -1121,6 +1123,7 @@
                         killEvent(e);
                         return;
                     case KEY.ENTER:
+                    case KEY.TAB:
                         this.selectHighlighted();
                         killEvent(e);
                         return;