fix #1426 - reinitting screws up tabindex
This commit is contained in:
parent
779b4bae70
commit
ce67f7b7fb
15
select2.js
15
select2.js
@ -763,21 +763,24 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
|
||||
// abstract
|
||||
destroy: function () {
|
||||
var select2 = this.opts.element.data("select2");
|
||||
var element=this.opts.element, select2 = element.data("select2");
|
||||
|
||||
if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
|
||||
|
||||
if (select2 !== undefined) {
|
||||
|
||||
select2.container.remove();
|
||||
select2.dropdown.remove();
|
||||
select2.opts.element
|
||||
element
|
||||
.removeClass("select2-offscreen")
|
||||
.removeData("select2")
|
||||
.off(".select2")
|
||||
.attr({"tabindex": this.elementTabIndex})
|
||||
.prop("autofocus", this.autofocus||false)
|
||||
.show();
|
||||
.prop("autofocus", this.autofocus || false);
|
||||
if (this.elementTabIndex) {
|
||||
element.attr({tabindex: this.elementTabIndex});
|
||||
} else {
|
||||
element.removeAttr("tabindex");
|
||||
}
|
||||
element.show();
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user