Skip to content

Commit c65355e

Browse files
committed
fixed focussing in IE8. fixes select2#342
1 parent e4fbf91 commit c65355e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

select2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,11 +1266,16 @@
12661266

12671267
// abstract
12681268
focusSearch: function () {
1269+
// need to do it here as well as in timeout so it works in IE
1270+
this.search.show();
1271+
this.search.focus();
1272+
12691273
/* we do this in a timeout so that current event processing can complete before this code is executed.
12701274
this makes sure the search field is focussed even if the current event would blur it */
12711275
window.setTimeout(this.bind(function () {
1272-
this.search.focus();
12731276
// reset the value so IE places the cursor at the end of the input box
1277+
this.search.show();
1278+
this.search.focus();
12741279
this.search.val(this.search.val());
12751280
}), 10);
12761281
},

0 commit comments

Comments
 (0)