8000 fix opts.minRow being undefined · gridstack/gridstack.js@f9dcf66 · GitHub
[go: up one dir, main page]

Skip to content

Commit f9dcf66

Browse files
committed
fix opts.minRow being undefined
* incorrect logic during updateOptions() making minRow=undefined, which messed getRow.
1 parent ca9715f commit f9dcf66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gridstack.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ export class GridStack {
10421042

10431043
/** returns the current number of rows, which will be at least `minRow` if set */
10441044
public getRow(): number {
1045-
return Math.max(this.engine.getRow(), this.opts.minRow);
1045+
return Math.max(this.engine.getRow(), this.opts.minRow || 0);
10461046
}
10471047

10481048
/**
@@ -1300,8 +1300,8 @@ export class GridStack {
13001300
if (o.float !== undefined) this.float(o.float);
13011301
if (o.row !== undefined) { opts.minRow = opts.maxRow = opts.row = o.row; }
13021302
else {
1303-
if (opts.minRow !== undefined) opts.minRow = o.minRow;
1304-
if (opts.maxRow !== undefined) opts.maxRow = o.maxRow;
1303+
if (o.minRow !== undefined) opts.minRow = o.minRow;
1304+
if (o.maxRow !== undefined) opts.maxRow = o.maxRow;
13051305
}
13061306
if (o.children?.length) this.load(o.children);
13071307
// TBD if we have a real need for these (more complex code)

0 commit comments

Comments
 (0)
0