Skip to content

Commit 5e71f4b

Browse files
committed
Locked items did not respected their positions when external items were dropped.
1 parent efb49d2 commit 5e71f4b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gridstack.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@
715715
node._added = true;
716716

717717
node.el = el;
718+
node.autoPosition = true;
718719
node.x = x;
719720
node.y = y;
720721
self.grid.cleanNodes();
@@ -733,13 +734,12 @@
733734
node._beforeDragY = node.y;
734735

735736
self._updateContainerHeight();
736-
} else {
737-
if (!self.grid.canMoveNode(node, x, y)) {
738-
return;
739-
}
740-
self.grid.moveNode(node, x, y);
741-
self._updateContainerHeight();
742737
}
738+
if (!self.grid.canMoveNode(node, x, y)) {
739+
return;
740+
}
741+
self.grid.moveNode(node, x, y);
742+
self._updateContainerHeight();
743743
};
744744

745745
$(self.container).droppable({

0 commit comments

Comments
 (0)