File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ GridStack.prototype._setupAcceptWidget = function(this: GridStack): GridStack {
131131 // set accept drop to true on ourself (which we ignore) so we don't get "can't drop" icon in HTML5 mode while moving
132132 if ( node ?. grid === this ) return true ;
133133 if ( ! this . opts . acceptWidgets ) return false ;
134+ // prevent deeper nesting until rest of 992 can be fixed
135+ if ( node ?. subGrid ) return false ;
134136 // check for accept method or class matching
135137 let canAccept = true ;
136138 if ( typeof this . opts . acceptWidgets === 'function' ) {
Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ export class GridStack {
293293 if ( parentGridItemEl && parentGridItemEl . gridstackNode ) {
294294 this . opts . _isNested = parentGridItemEl . gridstackNode ;
295295 this . opts . _isNested . subGrid = this ;
296+ parentGridItemEl . classList . add ( 'grid-stack-nested' ) ;
296297 this . el . classList . add ( 'grid-stack-nested' ) ;
297298 }
298299
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { DDManager } from './dd-manager';
88import { DDBaseImplement , HTMLElementExtendOpt } from './dd-base-impl' ;
99import { DDUtils } from './dd-utils' ;
1010import { GridHTMLElement , GridStack } from '../gridstack' ;
11+ import { GridItemHTMLElement } from '../types' ;
1112
1213export interface DDDroppableOpt {
1314 accept ?: string | ( ( el : HTMLElement ) => boolean ) ;
@@ -121,10 +122,12 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
121122 event . stopPropagation ( ) ;
122123
123124 // ignore leave events on our children (we get them when starting to drag our items)
124- // but exclude nested grids since we would still be leaving ourself
125+ // but exclude nested grids since we would still be leaving ourself,
126+ // but don't handle leave if we're dragging a nested grid around
125127 if ( ! forceLeave ) {
126128 let onChild = DDUtils . inside ( event , this . el ) ;
127- if ( onChild ) {
129+ let drag : GridItemHTMLElement = DDManager . dragElement . el ;
130+ if ( onChild && ! drag . gridstackNode ?. subGrid ) { // dragging a nested grid ?
128131 let nestedEl = ( this . el as GridHTMLElement ) . gridstack . engine . nodes . filter ( n => n . subGrid ) . map ( n => ( n . subGrid as GridStack ) . el ) ;
129132 onChild = ! nestedEl . some ( el => DDUtils . inside ( event , el ) ) ;
130133 }
You can’t perform that action at this time.
0 commit comments