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

Skip to content

minW larger than column fix #2964

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
Feb 26, 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 @@ -126,6 +126,7 @@ Change log
* fix: [#2939](https://github.com/gridstack/gridstack.js/issues/2939) custom drag handle not working with LazyLoad
* fix: [#2955](https://github.com/gridstack/gridstack.js/issues/2955) angular circular dependency
* fix: [#2951](https://github.com/gridstack/gridstack.js/issues/2951) shadow DOM dragging re-appending fix
* fix: [#2964](https://github.com/gridstack/gridstack.js/pull/2964) minW larger than column fix

## 11.3.0 (2025-01-26)
* feat: added `isIgnoreChangeCB()` if changeCB should be ignored due to column change, sizeToContent, loading, etc...
Expand Down
8 changes: 4 additions & 4 deletions src/gridstack-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ export class GridStackEngine {

const before = node._orig || Utils.copyPos({}, node);

if (node.maxW && node.w) { node.w = Math.min(node.w, node.maxW); }
if (node.maxH && node.h) { node.h = Math.min(node.h, node.maxH); }
if (node.minW && node.w && node.minW <= this.column) { node.w = Math.max(node.w, node.minW); }
if (node.minH && node.h) { node.h = Math.max(node.h, node.minH); }
if (node.maxW) { node.w = Math.min(node.w || 1, node.maxW); }
if (node.maxH) { node.h = Math.min(node.h || 1, node.maxH); }
if (node.minW) { node.w = Math.max(node.w || 1, node.minW); }
if (node.minH) { node.h = Math.max(node.h || 1, node.minH); }

// if user loaded a larger than allowed widget for current # of columns,
// remember it's position & width so we can restore back (1 -> 12 column) #1655 #1985
Expand Down