@linzjs/step-ag-grid 21.1.0 → 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.
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -2349,6 +2349,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2349
2349
|
const hasSetContentSize = React.useRef(false);
|
|
2350
2350
|
const hasSetContentSizeEmpty = React.useRef(false);
|
|
2351
2351
|
const needsAutoSize = React.useRef(true);
|
|
2352
|
+
const lastFullResize = React.useRef();
|
|
2352
2353
|
const setInitialContentSize = React.useCallback(() => {
|
|
2353
2354
|
if (!gridDivRef.current?.clientWidth || rowData == null) {
|
|
2354
2355
|
// Don't resize grids if they are offscreen as it doesn't work.
|
|
@@ -2376,8 +2377,14 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2376
2377
|
}
|
|
2377
2378
|
else if (gridRendered === "rows-visible") {
|
|
2378
2379
|
if (!hasSetContentSize.current) {
|
|
2379
|
-
|
|
2380
|
-
|
|
2380
|
+
if (lastFullResize.current === result.width) {
|
|
2381
|
+
hasSetContentSize.current = true;
|
|
2382
|
+
params.onContentSize?.(result);
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
needsAutoSize.current = true;
|
|
2386
|
+
}
|
|
2387
|
+
lastFullResize.current = result.width;
|
|
2381
2388
|
}
|
|
2382
2389
|
}
|
|
2383
2390
|
else {
|