diff --git a/src/components/common/DataGrid.tsx b/src/components/common/DataGrid.tsx index 993929fd2..fa6ec376d 100644 --- a/src/components/common/DataGrid.tsx +++ b/src/components/common/DataGrid.tsx @@ -84,11 +84,32 @@ export function DataGrid({ > {data && ( <> - + {/* + Wrap the table in a horizontally scrollable container. The + react-zen DataTable lays its columns out on a CSS Grid with + fixed pixel widths, so the sum of column widths becomes the + table's max-content and propagates up through the surrounding + flex chain into the Tabs grid track, pinning every ancestor + wider than the viewport on small screens. overflow-x: auto on + its own does not break that chain because the wrapper still + stretches to its parent's width. Setting display: grid with + grid-template-columns: minmax(0, 1fr) gives the wrapper an + explicit 1fr column that resolves to the available space, + caps its own intrinsic width, and lets overflow-x: auto + kick in so the user can scroll the columns horizontally + instead of having the card overflow off screen. + */} +
{isValidElement(child) ? cloneElement(child as ReactElement, { displayMode }) : child} - +
{showPager && (