From e88756b03772485f2f47a04162594ba166bf645e Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Mon, 6 Nov 2023 16:17:41 +0100 Subject: [PATCH] STCOM-1224 Include pagination height in MCL container height calculation (#2165) * STCOM-1224 Include pagination height in MCL container height calculation * STCOM-1224 Ignore paginationHeight for pagingTypes other than PREV_NEXT --- CHANGELOG.md | 1 + lib/MultiColumnList/MCLRenderer.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 536db5bc9..b83a82a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Make `` support input and textarea as an input field. Refs STCOM-1220. * Add support for new match option `containsAll` in ``. Refs STCOM-1223. * Ensure CSS visibility of datepicker's year input number spinner. Refs STCOM-1225. +* Include pagination height in MCL container height calculation. Refs STCOM-1224. ## [12.0.0](https://github.com/folio-org/stripes-components/tree/v12.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-components/compare/v11.0.0...v12.0.0) diff --git a/lib/MultiColumnList/MCLRenderer.js b/lib/MultiColumnList/MCLRenderer.js index 9830dd0ef..55d3224a5 100644 --- a/lib/MultiColumnList/MCLRenderer.js +++ b/lib/MultiColumnList/MCLRenderer.js @@ -1749,9 +1749,11 @@ class MCLRenderer extends React.Component { if (height !== undefined) { // if we have a totalCount, we can set size based on that... if not, the receivedRows count. const scrollBarHeight = 20; + const paginationHeight = pagingType === pagingTypes.PREV_NEXT ? this.paginationHeight : 0; + newHeight = Math.max( ((pagingType !== pagingTypes.SCROLL ? receivedRows : totalCount || receivedRows) * minimumRowHeight), - (height - this.headerHeight - scrollBarHeight) + (height - this.headerHeight - scrollBarHeight - paginationHeight) ); const rowContainerStyles = {