Skip to content

Commit

Permalink
fix: Change default resize to auto skip headers, Auto size grid when …
Browse files Browse the repository at this point in the history
…resizing columns

* Change default resize to auto-skip-headers

* Auto size columns on resize
  • Loading branch information
matttdawson committed May 29, 2023
1 parent 61a3b16 commit 22d3362
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const Grid = ({
rowSelection = "multiple",
suppressColumnVirtualization = true,
theme = "ag-theme-alpine",
sizeColumns = "auto",
sizeColumns = "auto-skip-headers",
...params
}: GridProps): JSX.Element => {
const {
Expand Down Expand Up @@ -418,6 +418,9 @@ export const Grid = ({
postSortRows={params.postSortRows ?? postSortRows}
onSelectionChanged={synchroniseExternalStateToGridSelection}
onColumnMoved={params.onColumnMoved}
onColumnResized={() => {
sizeColumns !== "none" && sizeColumnsToFit();
}}
alwaysShowVerticalScroll={params.alwaysShowVerticalScroll}
isExternalFilterPresent={isExternalFilterPresent}
doesExternalFilterPass={doesExternalFilterPass}
Expand Down

0 comments on commit 22d3362

Please sign in to comment.