Skip to content

Commit

Permalink
[DataGridPro] Don't throw error in column pinning (#9507)
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk authored Jun 28, 2023
1 parent 98ea130 commit d5fd310
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ export const useGridColumnPinning = (
return;
}

const rowContainer = apiRef.current.virtualScrollerRef!.current!;
if (!rowContainer) {
return;
}

const index = event.currentTarget.dataset.rowindex;
const rowElements = apiRef.current.virtualScrollerRef!.current!.querySelectorAll(
const rowElements = rowContainer.querySelectorAll(
`.${gridClasses.row}[data-rowindex="${index}"]`,
);
rowElements.forEach((row) => {
Expand Down

0 comments on commit d5fd310

Please sign in to comment.