@@ -110,7 +110,7 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
110110 accept : ( el : GridItemHTMLElement ) => {
111111 let node : GridStackNode = el . gridstackNode ;
112112 if ( node && node . grid === this ) {
113- return false ;
113+ return true ; // set accept drop to true on ourself (which we ignore) so we don't get "can't drop" icon in HTML5 mode while moving
114114 }
115115 if ( typeof this . opts . acceptWidgets === 'function' ) {
116116 return this . opts . acceptWidgets ( el ) ;
@@ -120,9 +120,11 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
120120 }
121121 } )
122122 . on ( this . el , 'dropover' , ( event , el : GridItemHTMLElement ) => {
123+ // ignore dropping on ourself, and prevent parent from receiving event
124+ let node = el . gridstackNode || { } ;
125+ if ( node . grid === this ) { return false ; }
123126
124127 // see if we already have a node with widget/height and check for attributes
125- let node = el . gridstackNode || { } ;
126128 if ( el . getAttribute && ( ! node . width || ! node . height ) ) {
127129 let w = parseInt ( el . getAttribute ( 'data-gs-width' ) ) ;
128130 if ( w > 0 ) { node . width = w ; }
@@ -166,6 +168,10 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
166168 return false ; // prevent parent from receiving msg (which may be grid as well)
167169 } )
168170 . on ( this . el , 'drop' , ( event , el : GridItemHTMLElement , helper : GridItemHTMLElement ) => {
171+ let node = el . gridstackNode ;
172+ // ignore drop on ourself from ourself - dragend will handle the simple move instead
173+ if ( node && node . grid === this ) { return false ; }
174+
169175 this . placeholder . remove ( ) ;
170176
171177 // notify previous grid of removal
@@ -179,7 +185,7 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
179185 oGrid . _triggerRemoveEvent ( ) ;
180186 }
181187
182- let node = el . gridstackNode ; // use existing placeholder node as it's already in our list with drop location
188+ // use existing placeholder node as it's already in our list with drop location
183189 if ( ! node ) { return false ; }
184190 const _id = node . _id ;
185191 this . engine . cleanupNode ( node ) ; // removes all internal _xyz values (including the _id so add that back)
0 commit comments