From c57ca74992213ed0be6948835835c42c2c040bd0 Mon Sep 17 00:00:00 2001 From: ChenHuanJie <191925313@qq.com> Date: Tue, 14 Dec 2021 15:26:55 +0800 Subject: [PATCH] Fix onScrollbarPresenceChange not invoking at correct timing --- source/Grid/Grid.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/Grid/Grid.js b/source/Grid/Grid.js index 76f0c17f0..9a1fab819 100644 --- a/source/Grid/Grid.js +++ b/source/Grid/Grid.js @@ -1011,9 +1011,13 @@ class Grid extends React.PureComponent { // Otherwise once scrollbars appear they may not disappear again. // For more info see issue #116 const verticalScrollBarSize = - totalRowsHeight > height ? instanceProps.scrollbarSize : 0; + totalRowsHeight + this._horizontalScrollBarSize > height + ? instanceProps.scrollbarSize + : 0; const horizontalScrollBarSize = - totalColumnsWidth > width ? instanceProps.scrollbarSize : 0; + totalColumnsWidth + this._verticalScrollBarSize > width + ? instanceProps.scrollbarSize + : 0; if ( horizontalScrollBarSize !== this._horizontalScrollBarSize ||