Skip to content

Commit 852784d

Browse files
committed
fixes select2#1504 - undo changes made to labels during init
1 parent 86fe603 commit 852784d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

select2.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,13 @@ the specific language governing permissions and limitations under the Apache Lic
18641864
this.focusser.focus();
18651865
},
18661866

1867+
// single
1868+
destroy: function() {
1869+
$("label[for='" + this.focusser.attr('id') + "']")
1870+
.attr('for', this.opts.element.attr("id"));
1871+
this.parent.destroy.apply(this, arguments);
1872+
},
1873+
18671874
// single
18681875
initContainer: function () {
18691876

@@ -2404,6 +2411,13 @@ the specific language governing permissions and limitations under the Apache Lic
24042411
}
24052412
},
24062413

2414+
// multi
2415+
destroy: function() {
2416+
$("label[for='" + this.search.attr('id') + "']")
2417+
.attr('for', this.opts.element.attr("id"));
2418+
this.parent.destroy.apply(this, arguments);
2419+
},
2420+
24072421
// multi
24082422
initContainer: function () {
24092423

0 commit comments

Comments
 (0)