diff --git a/select2.js b/select2.js index 668f7ce5..1bbbd17b 100644 --- a/select2.js +++ b/select2.js @@ -1864,6 +1864,13 @@ the specific language governing permissions and limitations under the Apache Lic this.focusser.focus(); }, + // single + destroy: function() { + $("label[for='" + this.focusser.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + // single initContainer: function () { @@ -2404,6 +2411,13 @@ the specific language governing permissions and limitations under the Apache Lic } }, + // multi + destroy: function() { + $("label[for='" + this.search.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + // multi initContainer: function () {