Skip to content

Commit 908c358

Browse files
committed
bind abbr handler before mousedown. fixes select2#386
1 parent ab7ab5b commit 908c358

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

select2.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,15 @@
14971497
window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10);
14981498
}));
14991499

1500+
selection.delegate("abbr", "mousedown", this.bind(function (e) {
1501+
if (!this.enabled) return;
1502+
this.clear();
1503+
killEventImmediately(e);
1504+
this.close();
1505+
this.triggerChange();
1506+
this.selection.focus();
1507+
}));
1508+
15001509
selection.bind("mousedown", this.bind(function (e) {
15011510
clickingInside = true;
15021511

@@ -1580,15 +1589,6 @@
15801589
killEvent(e);
15811590
}));
15821591

1583-
selection.delegate("abbr", "mousedown", this.bind(function (e) {
1584-
if (!this.enabled) return;
1585-
this.clear();
1586-
killEventImmediately(e);
1587-
this.close();
1588-
this.triggerChange();
1589-
this.selection.focus();
1590-
}));
1591-
15921592
this.setPlaceholder();
15931593

15941594
this.search.bind("focus", this.bind(function() {

0 commit comments

Comments
 (0)