Skip to content

Commit 21ff397

Browse files
committed
minW larger than column fix
* make sure minW is still applied before we constrain to current column count
1 parent 51c383d commit 21ff397

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Change log
126126
* fix: [#2939](https://github.com/gridstack/gridstack.js/issues/2939) custom drag handle not working with LazyLoad
127127
* fix: [#2955](https://github.com/gridstack/gridstack.js/issues/2955) angular circular dependency
128128
* fix: [#2951](https://github.com/gridstack/gridstack.js/issues/2951) shadow DOM dragging re-appending fix
129+
* fix: [#2964](https://github.com/gridstack/gridstack.js/pull/2964) minW larger than column fix
129130

130131
## 11.3.0 (2025-01-26)
131132
* feat: added `isIgnoreChangeCB()` if changeCB should be ignored due to column change, sizeToContent, loading, etc...

src/gridstack-engine.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ export class GridStackEngine {
408408

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

411-
if (node.maxW && node.w) { node.w = Math.min(node.w, node.maxW); }
412-
if (node.maxH && node.h) { node.h = Math.min(node.h, node.maxH); }
413-
if (node.minW && node.w && node.minW <= this.column) { node.w = Math.max(node.w, node.minW); }
414-
if (node.minH && node.h) { node.h = Math.max(node.h, node.minH); }
411+
if (node.maxW) { node.w = Math.min(node.w || 1, node.maxW); }
412+
if (node.maxH) { node.h = Math.min(node.h || 1, node.maxH); }
413+
if (node.minW) { node.w = Math.max(node.w || 1, node.minW); }
414+
if (node.minH) { node.h = Math.max(node.h || 1, node.minH); }
415415

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

0 commit comments

Comments
 (0)