Skip to content

Commit 2c3c960

Browse files
committed
Merge pull request selectize#171 from FMXpress/master
Fixed bug that left a '-1' tabindex on a select after destroying selectize
2 parents 953cf3d + 6873c8b commit 2c3c960

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/selectize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,7 @@ $.extend(Selectize.prototype, {
17521752
self.$input
17531753
.html('')
17541754
.append(revertSettings.$children)
1755+
.removeAttr('tabindex')
17551756
.attr({tabindex: revertSettings.tabindex})
17561757
.show();
17571758

test/api.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@
549549
expect(test.$select.html()).to.be.equal(children);
550550
expect(test.$select.attr('tabindex')).to.be.equal('9999');
551551
});
552+
it('should remove tabindex if it was originally undefined', function() {
553+
var test = setup_test('<select>', {});
554+
test.selectize.destroy();
555+
expect(test.$select.attr('tabindex')).to.be.equal(undefined);
556+
});
552557
});
553558

554559
});

0 commit comments

Comments
 (0)