From 360344fab80c840a3bdbaa75aeb90394d407f1e7 Mon Sep 17 00:00:00 2001 From: Daniel Salinas Date: Thu, 2 Dec 2021 13:06:05 -0500 Subject: [PATCH 1/2] Correction for onScroll throttling logic --- src/LargeList.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/LargeList.js b/src/LargeList.js index 578ed7b8..41bfb802 100644 --- a/src/LargeList.js +++ b/src/LargeList.js @@ -451,8 +451,7 @@ export class LargeList extends React.PureComponent { ); this.props.onScroll && this.props.onScroll(e); const now = new Date().getTime(); - if (this._lastTick - now > 30) { - this._lastTick = now; + if (now - this._lastTick < this.props.updateTimeInterval) { return; } this._lastTick = now; From 538734dab68fa3e5f6441d5fcdd6b63c786d5a94 Mon Sep 17 00:00:00 2001 From: Daniel Salinas Date: Thu, 2 Dec 2021 13:08:17 -0500 Subject: [PATCH 2/2] Apply fix to WaterfallList as well --- src/WaterfallList.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WaterfallList.js b/src/WaterfallList.js index 3e073ae9..fc347779 100644 --- a/src/WaterfallList.js +++ b/src/WaterfallList.js @@ -300,8 +300,7 @@ export class WaterfallList extends React.PureComponent { _onScroll = e => { this._contentOffsetY = e.nativeEvent.contentOffset.y; const now = new Date().getTime(); - if (this._lastTick - now > 30) { - this._lastTick = now; + if (now - this._lastTick < 30) { return; } this._lastTick = now;