Thanks to visit codestin.com
Credit goes to github.com

Skip to content

resizeToContentCheck() wasn't blocking _ignoreLayoutsNodeChange #3030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
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
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Change log
* rem [#3027](https://github.com/gridstack/gridstack.js/pull/3027) remove legacy code support for disableOneColumnMode, oneColumnSize, oneColumnModeDomSort
* fix [#3028](https://github.com/gridstack/gridstack.js/pull/3028) `updateOptions()` no longer modifies passed in struct. only field we check are being handled too.
* fix [#3029](https://github.com/gridstack/gridstack.js/pull/3029) `resizeToContent()` fix for nested grid with content above
* fix [#3030](https://github.com/gridstack/gridstack.js/pull/3030) `resizeToContentCheck()` wasn't blocking _ignoreLayoutsNodeChange at end of the loop

## 12.0.0 (2025-04-12)
* feat: [#2854](https://github.com/gridstack/gridstack.js/pull/2854) Removed dynamic stylesheet and migrated to CSS vars. Thank you [lmartorella](https://github.com/lmartorella)
Expand Down
2 changes: 2 additions & 0 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,9 @@ export class GridStack {
nodes.forEach(n => {
if (Utils.shouldSizeToContent(n)) this.resizeToContentCBCheck(n.el);
});
this._ignoreLayoutsNodeChange = true; // loop through each node will set/reset around each move, so set it here again
this.batchUpdate(false);
this._ignoreLayoutsNodeChange = false;
}
// call this regardless of shouldSizeToContent because widget might need to stretch to take available space after a resize
if (this._gsEventHandler['resizecontent']) this._gsEventHandler['resizecontent'](null, n ? [n] : this.engine.nodes);
Expand Down