From 94e004ef8c9e29deb1ca269ad541ddf8ef74dd84 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 27 Jul 2012 00:52:14 +0300 Subject: [PATCH] respect source element's tabindex --- select2.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index ce3a1bf4..ddb49e33 100755 --- a/select2.js +++ b/select2.js @@ -487,6 +487,8 @@ this.results = results = this.container.find(resultsSelector); this.search = search = this.container.find("input.select2-input"); + search.attr("tabIndex", this.opts.element.attr("tabIndex")); + this.resultsPage = 0; this.context = null; @@ -1292,7 +1294,7 @@ })); this.search.bind("blur", this.bind(function() { if (!this.opened()) this.container.removeClass("select2-container-active"); - window.setTimeout(this.bind(function() { this.selection.removeAttr("tabIndex"); }), 10); + window.setTimeout(this.bind(function() { this.selection.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10); })); selection.bind("click", this.bind(function (e) { @@ -1319,7 +1321,7 @@ selection.bind("blur", this.bind(function() { this.container.removeClass("select2-container-active"); - window.setTimeout(this.bind(function() { this.search.removeAttr("tabIndex"); }), 10); + window.setTimeout(this.bind(function() { this.search.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10); })); selection.bind("keydown", this.bind(function(e) {