@linzjs/step-ag-grid 21.0.1 → 21.0.3

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.
@@ -2362,6 +2362,10 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2362
2362
  const skipHeader = sizeColumns === "auto-skip-headers" && gridRendered === "rows-visible";
2363
2363
  if (sizeColumns === "auto" || skipHeader) {
2364
2364
  const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
2365
+ if (!result) {
2366
+ needsAutoSize.current = true;
2367
+ return;
2368
+ }
2365
2369
  if (gridRendered === "empty") {
2366
2370
  if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
2367
2371
  hasSetContentSizeEmpty.current = true;
@@ -4823,10 +4827,10 @@ const GridContextProvider = (props) => {
4823
4827
  * Resize columns to fit container
4824
4828
  */
4825
4829
  const autoSizeColumns = useCallback(({ skipHeader, colIds, userSizedColIds, includeFlex } = {}) => {
4826
- if (!gridApi)
4830
+ if (!gridApi || !gridApi.getColumnState())
4827
4831
  return null;
4828
4832
  const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
4829
- const colsToResize = gridApi.getColumnState().filter((colState) => {
4833
+ const colsToResize = gridApi.getColumnState()?.filter?.((colState) => {
4830
4834
  const colId = colState.colId;
4831
4835
  return ((isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
4832
4836
  !userSizedColIds?.has(colId) &&