-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
I have an issue when adding multiple external items via drag and drop. The first draggable item works well, the grid activates and shows the placeholder and moves existing nodes out of the way.
The problem is with subsequent items, the grid doesn't activate immediately like the first item. It will start working if the new dragged item is moved out and triggers the draggable dropout event.
I tracked it down to an issue with gridstack preventing droppable from calling deactivate after the item is dropped.
And I fixed it by changing gridstacks droppable accept function to check node._temporary
Before:
this.dd
.droppable(self.container, {
accept: function(el) {
el = $(el);
var node = el.data('_gridstack_node');
if (node && node._grid === self) {
return false;
}
return el.is(self.opts.acceptWidgets === true ? '.grid-stack-item' : self.opts.acceptWidgets);
}
})
After:
this.dd
.droppable(self.container, {
accept: function(el) {
el = $(el);
var node = el.data('_gridstack_node');
if (node && !node._temporary && node._grid === self) {
return false;
}
return el.is(self.opts.acceptWidgets === true ? '.grid-stack-item' : self.opts.acceptWidgets);
}
})
Metadata
Metadata
Assignees
Labels
No labels