From ec9fe488193b354b515ddcded40ccdaa3ad76f95 Mon Sep 17 00:00:00 2001 From: Albert Sun Date: Mon, 28 Jan 2019 11:48:31 -0800 Subject: [PATCH] Back out "[react-native][PR] [fix] Fixing overscrolling issue on Virtualized List" Summary: Reverting this change since it broke some initial scroll positions. It seems the proper API to use to limit overscrolling should be overScrollMode='never' Original commit changeset: 2ec5787218ec Reviewed By: olegbl Differential Revision: D13845053 fbshipit-source-id: 673aa529ef5171f26ce138573ee36f31f5d9799e --- Libraries/Lists/VirtualizedList.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index a14bcde7b..f6a9c6e2e 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -330,20 +330,13 @@ class VirtualizedList extends React.PureComponent { return; } const frame = this._getFrameMetricsApprox(index); - const maxScroll = - this._scrollMetrics.contentLength - this._scrollMetrics.visibleLength; - let offset = + const offset = Math.max( 0, frame.offset - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length), ) - (viewOffset || 0); - - /* Fix for overscrolling */ - if (offset > maxScroll) { - offset = maxScroll; - } /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment * suppresses an error when upgrading Flow's support for React. To see the * error delete this comment and run Flow. */