Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 815f04c

Browse files
committed
mobile: nested grid drag out fix
* fix #2887 * make sure we check for null since dragging a child out will destroy the old one, doing a double cleaning.
1 parent 22ec93a commit 815f04c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Change log
121121
## 11.1.1-dev (TBD)
122122
* fix: [#2877](https://github.com/gridstack/gridstack.js/pull/2877) angular wrapper uses standalone, while now being compatible down to ng14. thanks to [andre-steudel](https://github.com/andre-steudel)
123123
* fix: [#2886](https://github.com/gridstack/gridstack.js/issues/2886) added `gs-size-to-content` support
124+
* fix: [#2887](https://github.com/gridstack/gridstack.js/issues/2887) mobile nested grid TypeError: e.currentTarget is null
124125

125126
## 11.1.1 (2024-11-26)
126127
* fix: [#2878](https://github.com/gridstack/gridstack.js/pull/2878) make sure sub-grid inherit parent opts by default, with subgrid defaults.

src/dd-draggable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
224224
protected _mouseUp(e: MouseEvent): void {
225225
document.removeEventListener('mousemove', this._mouseMove, true);
226226
document.removeEventListener('mouseup', this._mouseUp, true);
227-
if (isTouch) {
227+
if (isTouch && e.currentTarget) { // destroy() during nested grid call us again wit fake _mouseUp
228228
e.currentTarget.removeEventListener('touchmove', touchmove, true);
229229
e.currentTarget.removeEventListener('touchend', touchend, true);
230230
}

0 commit comments

Comments
 (0)