From cb72d294f162a0ca06758692c675b2aeee732a83 Mon Sep 17 00:00:00 2001 From: Akshat Jawne <69530774+AkshatJawne@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:44:23 -0600 Subject: [PATCH] fix: Propogation of Scroll Events when Scroll Position is at a Boundary (#2166) Closes #2101 --- packages/grid/src/Grid.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/grid/src/Grid.tsx b/packages/grid/src/Grid.tsx index f56bd01cf7..8634b2be3d 100644 --- a/packages/grid/src/Grid.tsx +++ b/packages/grid/src/Grid.tsx @@ -2039,10 +2039,16 @@ class Grid extends PureComponent { } } - this.setViewState({ top, left, leftOffset, topOffset }); - - event.stopPropagation(); - event.preventDefault(); + if ( + metrics.top !== top || + metrics.left !== left || + metrics.topOffset !== topOffset || + metrics.leftOffset !== leftOffset + ) { + this.setViewState({ top, left, topOffset, leftOffset }); + event.stopPropagation(); + event.preventDefault(); + } } /**