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
8484
8585## 7.2.3-dev (TBD)
8686* 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
8788
8889## 7.2.3 (2023-02-02)
8990* 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
6565 this . el = el ;
6666 this . option = option ;
6767 // 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 ;
7070 // create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
7171 this . _mouseDown = this . _mouseDown . bind ( this ) ;
7272 this . _mouseMove = this . _mouseMove . bind ( this ) ;
@@ -138,12 +138,11 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
138138
139139 // make sure we are clicking on a drag handle or child of it...
140140 // 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+
147146 this . mouseDownEvent = e ;
148147 delete this . dragging ;
149148 delete DDManager . dragElement ;
You can’t perform that action at this time.
0 commit comments