Skip to content

Commit

Permalink
[DataGrid] Avoid paint step (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Nov 4, 2020
1 parent 453e2f1 commit 05ea7cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/grid/_modules_/grid/hooks/utils/useScrollFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export function useScrollFn(
if (renderingZoneElementRef.current!.style.pointerEvents !== 'none') {
renderingZoneElementRef.current!.style.pointerEvents = 'none';
}
renderingZoneElementRef.current!.style.transform = `translate(-${v.left}px, -${v.top}px)`;
columnHeadersElementRef.current!.style.transform = `translate(-${v.left}px, -0px)`;
// Force the creation of a layer, avoid paint when changing the transform value.
renderingZoneElementRef.current!.style.transform = `translate3d(-${v.left}px, -${v.top}px, 0)`;
columnHeadersElementRef.current!.style.transform = `translate3d(-${v.left}px, 0, 0)`;
debouncedResetPointerEvents();
previousValue.current = v;
}
Expand Down

0 comments on commit 05ea7cc

Please sign in to comment.