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

Skip to content

Commit ebc8c1f

Browse files
committed
Don't override node width when switching column mode
Fix case where specifying a minimum width for a node will cause the node's width to always be overridden and incorrectly cached, breaking the layout on restore.
1 parent ca83593 commit ebc8c1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gridstack-engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export class GridStackEngine {
345345

346346
if (node.maxW) { node.w = Math.min(node.w, node.maxW); }
347347
if (node.maxH) { node.h = Math.min(node.h, node.maxH); }
348-
if (node.minW) { node.w = Math.max(node.w, node.minW); }
348+
if (node.minW && node.minW < this.column) { node.w = Math.max(node.w, node.minW); }
349349
if (node.minH) { node.h = Math.max(node.h, node.minH); }
350350

351351
if (node.w > this.column) {

0 commit comments

Comments
 (0)