Skip to content

Commit

Permalink
fix pinned rows not working with dynamic row height
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Jul 4, 2022
1 parent 2fb7787 commit 51ddb67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/grid/x-data-grid/src/components/GridRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ function GridRow(props: React.HTMLAttributes<HTMLDivElement> & GridRowProps) {
// doesn't care about pagination and considers the rows from the current page only, so the
// first row always has index=0. We need to subtract the index of the first row to make it
// compatible with the index used by the virtualization.
apiRef.current.unstable_setLastMeasuredRowIndex(index - currentPage.range.firstRowIndex);
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(rowId);
// pinned rows are not part of the visible rows
if (typeof rowIndex != null) {
apiRef.current.unstable_setLastMeasuredRowIndex(rowIndex);
}
}

const rootElement = ref.current;
Expand Down

0 comments on commit 51ddb67

Please sign in to comment.