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 doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Change log

## 12.1.1-dev (TBD)
* fix [#3043](https://github.com/gridstack/gridstack.js/issues/3043) fix `opts.animate` again
* fix [#3047](https://github.com/gridstack/gridstack.js/pull/3047) nested grid resizeToContentCBCheck() fix
* fix [#3048](https://github.com/gridstack/gridstack.js/pull/3048) nested grid resizeToContentCBCheck() fix


## 12.1.1 (2024-04-28)
Expand Down
11 changes: 5 additions & 6 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2251,9 +2251,11 @@ export class GridStack {
delete this.placeholder.gridstackNode;

// disable animation when replacing a placeholder (already positioned) with actual content
const noAnim = wasAdded && this.opts.animate;
if (noAnim) this.setAnimation(false);

if (wasAdded && this.opts.animate) {
this.setAnimation(false);
this.setAnimation(true, true); // delay adding back
}

// notify previous grid of removal
// console.log('drop delete _gridstackNodeOrig') // TEST
const origNode = el._gridstackNodeOrig;
Expand Down Expand Up @@ -2314,9 +2316,6 @@ export class GridStack {
this._gsEventHandler['dropped']({ ...event, type: 'dropped' }, origNode && origNode.grid ? origNode : undefined, node);
}

// delay adding animation back
if (noAnim) this.setAnimation(this.opts.animate, true);

return false; // prevent parent from receiving msg (which may be grid as well)
});
return this;
Expand Down