Skip to content

Commit 882e799

Browse files
committed
keep focus in control when the mask is clicked
1 parent 4094c1c commit 882e799

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

select2.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,8 @@ the specific language governing permissions and limitations under the Apache Lic
12241224
self.selectHighlighted({noFocus: true});
12251225
}
12261226
self.close();
1227+
e.preventDefault();
1228+
e.stopPropagation();
12271229
}
12281230
});
12291231
}
@@ -1884,6 +1886,7 @@ the specific language governing permissions and limitations under the Apache Lic
18841886
})).bind("blur", this.bind(function() {
18851887
if (!this.opened()) {
18861888
this.container.removeClass("select2-container-active");
1889+
this.opts.element.trigger($.Event("select2-blur"));
18871890
}
18881891
}));
18891892
this.search.bind("focus", this.bind(function(){
@@ -2382,6 +2385,7 @@ the specific language governing permissions and limitations under the Apache Lic
23822385
this.selectChoice(null);
23832386
if (!this.opened()) this.clearSearch();
23842387
e.stopImmediatePropagation();
2388+
this.opts.element.trigger($.Event("select2-blur"));
23852389
}));
23862390

23872391
this.container.delegate(selector, "mousedown", this.bind(function (e) {

0 commit comments

Comments
 (0)