Skip to content

Commit 732ad03

Browse files
committed
fix tab index issues. fixes select2#408
1 parent 0c11ed7 commit 732ad03

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

select2.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,15 @@
15021502
}));
15031503
this.search.bind("blur", this.bind(function() {
15041504
if (!this.opened()) this.container.removeClass("select2-container-active");
1505-
window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10);
1505+
window.setTimeout(this.bind(function() {
1506+
// restore original tab index
1507+
var ti=this.opts.element.attr("tabIndex");
1508+
if (ti) {
1509+
this.selection.attr("tabIndex", ti);
1510+
} else {
1511+
this.selection.removeAttr("tabIndex");
1512+
}
1513+
}), 10);
15061514
}));
15071515

15081516
selection.delegate("abbr", "mousedown", this.bind(function (e) {

0 commit comments

Comments
 (0)