Browse Source

remove event listener on destroy

burnb 10 năm trước cách đây
mục cha
commit
557f655c86
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      src/js/select2/core.js

+ 2 - 0
src/js/select2/core.js

@@ -443,6 +443,8 @@ define([
     if (this._observer != null) {
       this._observer.disconnect();
       this._observer = null;
+    } else if (this.$element[0].removeEventListener) {
+      this.$element[0].removeEventListener('DOMAttrModified', this._sync, false);
     }
 
     this._sync = null;