Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/two_vertical.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1>Two vertical grids demo - with maxRow</h1>
acceptWidgets: true
}
GridStack.init(opts, document.getElementById('grid1'))
.load([{x:0, y:0, content: '0'}, {x:1, y:0, content: '1'}]);
.load([{x:1, y:0, content: '0'}, {x:2, y:0, content: '1'}]);
GridStack.init(opts, document.getElementById('grid2'))
.load([{x:0, y:0, content: '2'}, {x:1, y:0, content: '3'}]);
</script>
Expand Down
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Change log
* fix: [#3099](https://github.com/gridstack/gridstack.js/issues/3099) scroll take into account ScrollContainer position
* fix: [#3102](https://github.com/gridstack/gridstack.js/pull/3102) React demo now support multiple grids
* fix: [#3047](https://github.com/gridstack/gridstack.js/issues/3047) added `.grid-stack-dragging` to grid when child is being dragged so we can set cursor:grabbing, updated demo.
* fix: [#3021](https://github.com/gridstack/gridstack.js/issues/3021) correctly reset widget back (to last known position) when released outside

## 12.2.2 (2025-07-06)
* fix: [#3070](https://github.com/gridstack/gridstack.js/pull/3070) incorrect property name 'sizeToContent' when cleaning up invalid attributes
Expand Down
5 changes: 2 additions & 3 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export class GridStack {
if (nodeToAdd?._moving) subGrid._isTemp = true; // prevent re-nesting as we add over
if (autoColumn) subGrid._autoColumn = true;

// add the original content back as a child of hte newly created grid
// add the original content back as a child of the newly created grid
if (saveContent) {
subGrid.makeWidget(newItem, newItemOpt);
}
Expand Down Expand Up @@ -2424,8 +2424,7 @@ export class GridStack {
} else {
Utils.removePositioningStyles(target);
if (node._temporaryRemoved) {
// got removed - restore item back to before dragging position
Utils.copyPos(node, node._orig);// @ts-ignore
// use last position we were at (not _orig as we may have pushed others and moved) and add it back
this._writePosAttr(target, node);
this.engine.addNode(node);
} else {
Expand Down