Browse Source

fixed focussing in IE8. fixes #342

Igor Vaynberg 12 years ago
parent
commit
c65355edee
1 changed files with 6 additions and 1 deletions
  1. 6 1
      select2.js

+ 6 - 1
select2.js

@@ -1266,11 +1266,16 @@
 
         // abstract
         focusSearch: function () {
+            // need to do it here as well as in timeout so it works in IE
+            this.search.show();
+            this.search.focus();
+
             /* we do this in a timeout so that current event processing can complete before this code is executed.
              this makes sure the search field is focussed even if the current event would blur it */
             window.setTimeout(this.bind(function () {
-                this.search.focus();
                 // reset the value so IE places the cursor at the end of the input box
+                this.search.show();
+                this.search.focus();
                 this.search.val(this.search.val());
             }), 10);
         },