From 882e7996f4000f7c352974d621548657e56363cd Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 6 May 2013 20:05:15 -0700 Subject: [PATCH] keep focus in control when the mask is clicked --- select2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/select2.js b/select2.js index 56ace85d..c79f8c90 100644 --- a/select2.js +++ b/select2.js @@ -1224,6 +1224,8 @@ the specific language governing permissions and limitations under the Apache Lic self.selectHighlighted({noFocus: true}); } self.close(); + e.preventDefault(); + e.stopPropagation(); } }); } @@ -1884,6 +1886,7 @@ the specific language governing permissions and limitations under the Apache Lic })).bind("blur", this.bind(function() { if (!this.opened()) { this.container.removeClass("select2-container-active"); + this.opts.element.trigger($.Event("select2-blur")); } })); this.search.bind("focus", this.bind(function(){ @@ -2382,6 +2385,7 @@ the specific language governing permissions and limitations under the Apache Lic this.selectChoice(null); if (!this.opened()) this.clearSearch(); e.stopImmediatePropagation(); + this.opts.element.trigger($.Event("select2-blur")); })); this.container.delegate(selector, "mousedown", this.bind(function (e) {