From d072a05227a343165891c2c19b9a81753bf55a32 Mon Sep 17 00:00:00 2001 From: paola-p <> Date: Mon, 8 Jan 2024 19:16:16 +0100 Subject: [PATCH] add prop to set a static column width of Grid View --- .../src/informative/PaginatedList/views/GridView.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/components/src/informative/PaginatedList/views/GridView.js b/packages/components/src/informative/PaginatedList/views/GridView.js index a2d66b001..50b07f6e2 100644 --- a/packages/components/src/informative/PaginatedList/views/GridView.js +++ b/packages/components/src/informative/PaginatedList/views/GridView.js @@ -23,6 +23,7 @@ const GRID_VIEW_PROP_TYPES = { rows: PropTypes.array, headerGroups: PropTypes.array, prepareRow: PropTypes.func, + staticColumnWidth: PropTypes.bool, }; const GridView = ({ @@ -64,6 +65,14 @@ const GridView = ({ rows.length < columns ? `minmax(${itemMinWidth}px, ${itemMinWidth}px)` : `minmax(${itemMinWidth}px, 1fr)`; + + if (props.staticColumnWidth) + return { + ...style, + display: 'grid', + gridTemplateColumns: `repeat(auto-fit, ${itemMinWidth})`, + }; + return { ...style, display: 'grid',