Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
fix: account for collapsed alwaysExpanded
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlahti committed Sep 13, 2023
1 parent 57c43c2 commit e44b318
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e44b318

Please sign in to comment.