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

Skip to content

Commit 434fb9b

Browse files
authored
Merge pull request gridstack#2742 from adumesny/master
nested grid drag fix
2 parents 1aa6c8c + 48a5474 commit 434fb9b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Change log
115115

116116
## 10.3.0-dev (TBD)
117117
* fix: [#2734](https://github.com/gridstack/gridstack.js/bug/2734) rotate() JS error
118-
* fix: [#2739](https://github.com/gridstack/gridstack.js/pull/2739) resizeToContent JS error with nested grid
118+
* fix: [#2741](https://github.com/gridstack/gridstack.js/pull/2741) resizeToContent JS error with nested grid
119+
* fix: [#2740](https://github.com/gridstack/gridstack.js/bug/2740) nested grid drag fix
119120

120121
## 10.3.0 (2024-06-26)
121122
* fix: [#2720](https://github.com/gridstack/gridstack.js/pull/2720) load() now creates widgets in order (used to be reverse due to old collision code)

src/dd-draggable.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
7979
super();
8080

8181
// get the element that is actually supposed to be dragged by
82-
let handleName = option.handle.substring(1);
83-
this.dragEls = el.classList.contains(handleName) ? [el] : Array.from(el.querySelectorAll(option.handle));
82+
const handleName = option.handle.substring(1);
83+
const n = el.gridstackNode;
84+
this.dragEls = el.classList.contains(handleName) ? [el] : (n?.subGrid ? [el.querySelector(option.handle) || el] : Array.from(el.querySelectorAll(option.handle)));
8485
if (this.dragEls.length === 0) {
8586
this.dragEls = [el];
8687
}

0 commit comments

Comments
 (0)