Skip to content

Commit 94e004e

Browse files
committed
respect source element's tabindex
1 parent 38b9e93 commit 94e004e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

select2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@
487487
this.results = results = this.container.find(resultsSelector);
488488
this.search = search = this.container.find("input.select2-input");
489489

490+
search.attr("tabIndex", this.opts.element.attr("tabIndex"));
491+
490492
this.resultsPage = 0;
491493
this.context = null;
492494

@@ -1292,7 +1294,7 @@
12921294
}));
12931295
this.search.bind("blur", this.bind(function() {
12941296
if (!this.opened()) this.container.removeClass("select2-container-active");
1295-
window.setTimeout(this.bind(function() { this.selection.removeAttr("tabIndex"); }), 10);
1297+
window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10);
12961298
}));
12971299

12981300
selection.bind("click", this.bind(function (e) {
@@ -1319,7 +1321,7 @@
13191321

13201322
selection.bind("blur", this.bind(function() {
13211323
this.container.removeClass("select2-container-active");
1322-
window.setTimeout(this.bind(function() { this.search.removeAttr("tabIndex"); }), 10);
1324+
window.setTimeout(this.bind(function() { this.search.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10);
13231325
}));
13241326

13251327
selection.bind("keydown", this.bind(function(e) {

0 commit comments

Comments
 (0)