File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ Change log
84
84
85
85
## 7.2.3-dev (TBD)
86
86
* fix [ #2206 ] ( https://github.com/gridstack/gridstack.js/issues/2206 ) ` load() ` with collision fix
87
+ * fix [ #2210 ] ( https://github.com/gridstack/gridstack.js/pull/2210 ) restored checking for grid option.handle draggable area
87
88
88
89
## 7.2.3 (2023-02-02)
89
90
* fix ` addWidget() ` to handle passing just {el} which was needed for Angular HMTL template demo
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
65
65
this . el = el ;
66
66
this . option = option ;
67
67
// get the element that is actually supposed to be dragged by
68
- let className = option . handle . substring ( 1 ) ;
69
- this . dragEl = el . classList . contains ( className ) ? el : el . querySelector ( option . handle ) || el ;
68
+ let handleName = option . handle . substring ( 1 ) ;
69
+ this . dragEl = el . classList . contains ( handleName ) ? el : el . querySelector ( option . handle ) || el ;
70
70
// create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
71
71
this . _mouseDown = this . _mouseDown . bind ( this ) ;
72
72
this . _mouseMove = this . _mouseMove . bind ( this ) ;
@@ -138,12 +138,11 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
138
138
139
139
// make sure we are clicking on a drag handle or child of it...
140
140
// Note: we don't need to check that's handle is an immediate child, as mouseHandled will prevent parents from also handling it (lowest wins)
141
- //
142
- // REMOVE: why would we get the event if it wasn't for us or child ?
143
- // let className = this.option.handle.substring(1);
144
- // let el = e.target as HTMLElement;
145
- // while (el && !el.classList.contains(className)) { el = el.parentElement; }
146
- // if (!el) return;
141
+ let className = this . option . handle . substring ( 1 ) ;
142
+ let el = e . target as HTMLElement ;
143
+ while ( el && ! el . classList . contains ( className ) ) { el = el . parentElement ; }
144
+ if ( ! el ) return ;
145
+
147
146
this . mouseDownEvent = e ;
148
147
delete this . dragging ;
149
148
delete DDManager . dragElement ;
You can’t perform that action at this time.
0 commit comments