1
0
mirror of synced 2024-11-30 00:26:03 +03:00

fix selectOnBlur when closed by means other then tab key. fixes #470

This commit is contained in:
Igor Vaynberg 2013-02-01 11:09:08 -08:00
parent a19e33e3af
commit 22dba24881

View File

@ -534,9 +534,13 @@ the specific language governing permissions and limitations under the Apache Lic
mask.hide(); mask.hide();
mask.appendTo(this.body()); mask.appendTo(this.body());
mask.bind("mousedown touchstart", function (e) { mask.bind("mousedown touchstart", function (e) {
var dropdown = $("#select2-drop"); var dropdown = $("#select2-drop"), self;
if (dropdown.length > 0) { if (dropdown.length > 0) {
dropdown.data("select2").close(); self=dropdown.data("select2");
if (self.opts.selectOnBlur) {
self.selectHighlighted({noFocus: true});
}
self.close();
} }
}); });
} }