Skip to content

Commit 78526a3

Browse files
committed
Update select2.js
fixed destroy
1 parent 0d98939 commit 78526a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

select2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ the specific language governing permissions and limitations under the Apache Lic
836836

837837
// abstract
838838
destroy: function () {
839-
var element=this.opts.element, select2 = element.data("select2");
839+
var element=this.opts.element, select2 = element.data("select2"), self = this;
840840

841841
this.close();
842842

843843
if (element.length && element[0].detachEvent) {
844844
element.each(function () {
845-
this.detachEvent("onpropertychange", this._sync);
845+
this.detachEvent("onpropertychange", self._sync);
846846
});
847847
}
848848
if (this.propertyObserver) {

0 commit comments

Comments
 (0)