From ed0bae39c9c41c2d398e0ecd14e5771eda2dbea2 Mon Sep 17 00:00:00 2001 From: Lee Boynton Date: Fri, 28 Mar 2014 14:56:45 +0000 Subject: [PATCH] Check if search should be focused when the dropdown is activated --- select2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index ffe6b64b..c3a33664 100644 --- a/select2.js +++ b/select2.js @@ -2144,7 +2144,11 @@ the specific language governing permissions and limitations under the Apache Lic killEvent(e); })); - dropdown.on("mousedown touchstart", this.bind(function() { this.search.focus(); })); + dropdown.on("mousedown touchstart", this.bind(function() { + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + } + })); selection.on("focus", this.bind(function(e) { killEvent(e);