@@ -120,9 +120,12 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
120
120
}
121
121
} )
122
122
. on ( this . el , 'dropover' , ( event , el : GridItemHTMLElement ) => {
123
- // ignore dropping on ourself, and prevent parent from receiving event
123
+ // ignore drop enter on ourself, and prevent parent from receiving event
124
124
let node = el . gridstackNode || { } ;
125
- if ( node . grid === this ) { return false ; }
125
+ if ( node . grid === this ) {
126
+ delete node . _added ; // reset this to track placeholder again in case we were over other grid #1484 (dropout doesn't always clear)
127
+ return false ;
128
+ }
126
129
127
130
// see if we already have a node with widget/height and check for attributes
128
131
if ( el . getAttribute && ( ! node . width || ! node . height ) ) {
@@ -151,12 +154,18 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
151
154
return false ; // prevent parent from receiving msg (which may be grid as well)
152
155
} )
153
156
. on ( this . el , 'dropout' , ( event , el : GridItemHTMLElement ) => {
157
+ let node = el . gridstackNode ;
158
+ if ( ! node ) { return ; }
159
+
160
+ // clear any added flag now that we are leaving #1484
161
+ delete node . _added ;
162
+
154
163
// jquery-ui bug. Must verify widget is being dropped out
155
164
// check node variable that gets set when widget is out of grid
156
- let node = el . gridstackNode ;
157
- if ( ! node || ! node . _isOutOfGrid ) {
165
+ if ( ! node . _isOutOfGrid ) {
158
166
return ;
159
167
}
168
+
160
169
GridStackDD . get ( ) . off ( el , 'drag' ) ;
161
170
node . el = null ;
162
171
this . engine . removeNode ( node ) ;
0 commit comments