From f9dcf664dd0cede5bb30cb668872ed5cfa3258e7 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Mon, 28 Apr 2025 10:02:19 -0700 Subject: [PATCH] fix opts.minRow being undefined * incorrect logic during updateOptions() making minRow=undefined, which messed getRow. --- src/gridstack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gridstack.ts b/src/gridstack.ts index 6b8866ca..78ac9ac3 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -1042,7 +1042,7 @@ export class GridStack { /** returns the current number of rows, which will be at least `minRow` if set */ public getRow(): number { - return Math.max(this.engine.getRow(), this.opts.minRow); + return Math.max(this.engine.getRow(), this.opts.minRow || 0); } /** @@ -1300,8 +1300,8 @@ export class GridStack { if (o.float !== undefined) this.float(o.float); if (o.row !== undefined) { opts.minRow = opts.maxRow = opts.row = o.row; } else { - if (opts.minRow !== undefined) opts.minRow = o.minRow; - if (opts.maxRow !== undefined) opts.maxRow = o.maxRow; + if (o.minRow !== undefined) opts.minRow = o.minRow; + if (o.maxRow !== undefined) opts.maxRow = o.maxRow; } if (o.children?.length) this.load(o.children); // TBD if we have a real need for these (more complex code)