minMax can be undefined

This commit is contained in:
Niels Lyngsø
2024-05-16 13:00:34 +02:00
parent d9c0e12e0a
commit 3e1e140a1c

View File

@@ -135,7 +135,10 @@ export class UmbBlockGridScaleManager extends UmbControllerBase {
const bestColumnSpanOption = closestColumnSpanOption(newColumnSpan, spanOptions, layoutColumns - blockStartCol);
newColumnSpan = bestColumnSpanOption ?? layoutColumns;
const [rowMinSpan, rowMaxSpan] = this._host.getMinMaxRowSpan();
// Find allowed row spans:
const minMaxRowSpan = this._host.getMinMaxRowSpan();
if (!minMaxRowSpan) return;
const [rowMinSpan, rowMaxSpan] = minMaxRowSpan;
let newRowSpan = Math.round(Math.max(blockEndRow - blockStartRow, rowMinSpan));
if (rowMaxSpan != null) {
newRowSpan = Math.min(newRowSpan, rowMaxSpan);