Skip to content

Commit

Permalink
[DataGrid] Fix scroll error (#15521)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii authored Nov 28, 2024
1 parent 511ad9f commit ca7dd3d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,14 @@ export const useGridVirtualScroller = () => {
);

const triggerUpdateRenderContext = useEventCallback(() => {
const scroller = scrollerRef.current;
if (!scroller) {
return undefined;
}

const newScroll = {
top: scrollerRef.current!.scrollTop,
left: scrollerRef.current!.scrollLeft,
top: scroller.scrollTop,
left: scroller.scrollLeft,
};

const dx = newScroll.left - scrollPosition.current.left;
Expand Down

0 comments on commit ca7dd3d

Please sign in to comment.