Topic: Bug draggable plugin: please turn off "resize" in dispose()
Actual behavior
Resize event is turn on, but does not turn off in dispose...
and therefore it generates multiple errors once the element has been disposed.
/src/plugins/drag-and-drop/js/draggable.js
_dragTriggers() {
EventHandler.on(this.dragEl, 'touchstart', this._dragStart);
EventHandler.on(this.dragEl, 'mousedown', this._dragStart);
EventHandler.on(window, 'resize', this._takeAgainCoordinates);
}
dispose() {
EventHandler.off(this.dragEl, 'touchstart', this._dragStart);
EventHandler.off(this.dragEl, 'mousedown', this._dragStart);
Data.removeData(this._element, DATA_KEY);
this._element = null; }
Expected behavior
dispose() {
EventHandler.off(this.dragEl, 'touchstart', this._dragStart);
EventHandler.off(this.dragEl, 'mousedown', this._dragStart);
Data.removeData(this._element, DATA_KEY);
EventHandler.off(window, 'resize', this._takeAgainCoordinates); // <= *THIS*
this._element = null; }
Thanks
Michał Duszak staff answered 3 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 3.8.1
- Device: macbook pro
- Browser: chrome
- OS: big sur
- Provided sample code: No
- Provided link: No