@linzjs/step-ag-grid 21.0.1 → 21.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "21.0.1",
5
+ "version": "21.0.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -182,6 +182,10 @@ export const Grid = ({
182
182
  const skipHeader = sizeColumns === "auto-skip-headers" && gridRendered === "rows-visible";
183
183
  if (sizeColumns === "auto" || skipHeader) {
184
184
  const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
185
+ if (!result) {
186
+ needsAutoSize.current = true;
187
+ return;
188
+ }
185
189
  if (gridRendered === "empty") {
186
190
  if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
187
191
  hasSetContentSizeEmpty.current = true;
@@ -403,9 +403,9 @@ export const GridContextProvider = <TData extends GridBaseRow>(props: PropsWithC
403
403
  */
404
404
  const autoSizeColumns = useCallback(
405
405
  ({ skipHeader, colIds, userSizedColIds, includeFlex }: AutoSizeColumnsProps = {}): AutoSizeColumnsResult => {
406
- if (!gridApi) return null;
406
+ if (!gridApi || !gridApi.getColumnState()) return null;
407
407
  const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
408
- const colsToResize = gridApi.getColumnState().filter((colState) => {
408
+ const colsToResize = gridApi.getColumnState()?.filter?.((colState) => {
409
409
  const colId = colState.colId;
410
410
  return (
411
411
  (isEmpty(colIdsSet) || colIdsSet.has(colId)) &&