@linzjs/step-ag-grid 21.0.4 → 21.1.1

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.
@@ -2347,6 +2347,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2347
2347
  const hasSetContentSize = useRef(false);
2348
2348
  const hasSetContentSizeEmpty = useRef(false);
2349
2349
  const needsAutoSize = useRef(true);
2350
+ const lastFullResize = useRef();
2350
2351
  const setInitialContentSize = useCallback(() => {
2351
2352
  if (!gridDivRef.current?.clientWidth || rowData == null) {
2352
2353
  // Don't resize grids if they are offscreen as it doesn't work.
@@ -2374,8 +2375,14 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2374
2375
  }
2375
2376
  else if (gridRendered === "rows-visible") {
2376
2377
  if (!hasSetContentSize.current) {
2377
- hasSetContentSize.current = true;
2378
- params.onContentSize?.(result);
2378
+ if (lastFullResize.current === result.width) {
2379
+ hasSetContentSize.current = true;
2380
+ params.onContentSize?.(result);
2381
+ }
2382
+ else {
2383
+ needsAutoSize.current = true;
2384
+ }
2385
+ lastFullResize.current = result.width;
2379
2386
  }
2380
2387
  }
2381
2388
  else {
@@ -2812,6 +2819,7 @@ const GridPopoverContext = createContext({
2812
2819
  anchorRef: { current: null },
2813
2820
  saving: false,
2814
2821
  setSaving: () => { },
2822
+ colId: "",
2815
2823
  field: "",
2816
2824
  value: null,
2817
2825
  data: {},
@@ -2832,6 +2840,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
2832
2840
  // Then item that is clicked on will always be first in the list
2833
2841
  const selectedRows = useMemo(() => multiEdit ? sortBy(getFilteredSelectedRows(), (row) => row.id !== props.data.id) : [props.data], [getFilteredSelectedRows, multiEdit, props.data]);
2834
2842
  const field = props.colDef?.field ?? "";
2843
+ const colId = props.colDef?.colId ?? field ?? "";
2835
2844
  const updateValue = useCallback(async (saveFn, tabDirection) => {
2836
2845
  if (hasSaved.current)
2837
2846
  return true;
@@ -2843,6 +2852,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
2843
2852
  saving,
2844
2853
  setSaving,
2845
2854
  selectedRows,
2855
+ colId,
2846
2856
  field,
2847
2857
  data: props.data,
2848
2858
  value: props.value,