From c65355edee54ef3050b9332071f5ee56313e9bab Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 16 Aug 2012 23:36:26 -0700 Subject: [PATCH] fixed focussing in IE8. fixes #342 --- select2.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index cfb6c087..cbd10fff 100755 --- a/select2.js +++ b/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); },