From 69ea3a0c87f4438d6a5637a1db71dc44dc20b604 Mon Sep 17 00:00:00 2001 From: Rahul Yadav <52163880+rahulyadav5524@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:52:00 +0530 Subject: [PATCH] Stopped recalculating sticky width --- packages/core/src/internal/data-grid/data-grid.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/internal/data-grid/data-grid.tsx b/packages/core/src/internal/data-grid/data-grid.tsx index 52338a786..7479557ac 100644 --- a/packages/core/src/internal/data-grid/data-grid.tsx +++ b/packages/core/src/internal/data-grid/data-grid.tsx @@ -440,7 +440,7 @@ const DataGrid: React.ForwardRefRenderFunction = (p, }, [cellYOffset, cellXOffset, translateX, translateY, enableFirefoxRescaling, enableSafariRescaling]); const mappedColumns = useMappedColumns(columns, freezeColumns); - const stickyX = fixedShadowX ? getStickyWidth(mappedColumns, dragAndDropState) : 0; + const stickyX = React.useMemo(() => fixedShadowX ? getStickyWidth(mappedColumns, dragAndDropState) : 0,[mappedColumns, dragAndDropState, fixedShadowX]); // row: -1 === columnHeader, -2 === groupHeader const getBoundsForItem = React.useCallback(