From e44b318751933e660f931e2c24ce3ca3046d4e7e Mon Sep 17 00:00:00 2001 From: Johan Lahti Date: Wed, 13 Sep 2023 12:08:37 +0200 Subject: [PATCH] fix: account for collapsed alwaysExpanded --- .../ListboxGrid/distribute-resources-counting.ts | 16 +--------------- .../ListboxGrid/distribute-resources.ts | 1 - 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources-counting.ts b/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources-counting.ts index 4661696a..8bda139f 100644 --- a/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources-counting.ts +++ b/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources-counting.ts @@ -10,21 +10,7 @@ const getExpandedRowHeight = (dense: boolean, isGridMode = false) => { }; export function getListBoxMinHeight(resource: IListboxResource, outerWidth = false) { - const { dense = false, collapseMode, dataLayout } = resource.layout.layoutOptions || {}; - - let h = 0; - if (collapseMode === 'never') { - // Calculate min expanded height. - h += getExpandedRowHeight(dense, dataLayout === 'grid'); - h += resource.hasHeader ? EXPANDED_HEADER_HEIGHT : 0; - } else { - // Calculate collapsed height. - h += COLLAPSED_HEIGHT; - } - if (outerWidth) { - h += ITEM_SPACING; - } - + const h = COLLAPSED_HEIGHT + (outerWidth ? ITEM_SPACING : 0); return h; } diff --git a/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources.ts b/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources.ts index f67f6d31..2cfc6c46 100644 --- a/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources.ts +++ b/packages/sn-filter-pane/src/components/ListboxGrid/distribute-resources.ts @@ -106,7 +106,6 @@ export function balanceColumns(size: ISize, columns: IColumn[], resources: IList column.itemCount = itemCount; } else { // …and if it does not fit, we can move it to the last column and make items hidden. - lastColumn.itemCount = lastColumn.itemCount ?? 0; lastColumn.itemCount = 0; lastColumn.hiddenItems = true; }