From 501b648c618a56f00ccbad756be5398f513c6c53 Mon Sep 17 00:00:00 2001 From: Kenan Yusuf Date: Wed, 28 Aug 2024 11:02:46 +0100 Subject: [PATCH] fix column pinning when virtualization is disabled --- .../src/hooks/features/columnHeaders/useGridColumnHeaders.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx b/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx index de3a72f4a844..ef264997b4e0 100644 --- a/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx +++ b/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx @@ -168,7 +168,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => { maxLastColumn = visibleColumns.length, } = params || {}; - const firstColumnToRender = !hasVirtualization ? 0 : currentContext.firstColumnIndex; + const firstColumnToRender = currentContext.firstColumnIndex; const lastColumnToRender = !hasVirtualization ? maxLastColumn : currentContext.lastColumnIndex; const renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);