From e0c73633cfc0a62df9d39991b0df65fa5875609a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20K=2E=20Brosb=C3=B8l?= Date: Fri, 20 Jul 2018 00:12:05 -0700 Subject: [PATCH] VirtualizedList: Fix spacer size calculation (#18105) Summary: See https://github.com/facebook/react-native/issues/18104 Tested the above snack with: - stickyHeadersEnabled true/false - initialScrollIndex set and not Visibly verified consistent rendering. [GENERAL] [BUGFIX] [VirtualizedList] - Fix for jumpy content when initialScrollIndex specified Pull Request resolved: https://github.com/facebook/react-native/pull/18105 Differential Revision: D8382122 Pulled By: sahrens fbshipit-source-id: 9421351469e8684bc61438605abbd9988b664c29 --- Libraries/Lists/VirtualizedList.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index ba9224c46..2efbba657 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -805,8 +805,7 @@ class VirtualizedList extends React.PureComponent { if (stickyIndicesFromProps.has(ii + stickyOffset)) { const initBlock = this._getFrameMetricsApprox(lastInitialIndex); const stickyBlock = this._getFrameMetricsApprox(ii); - const leadSpace = - stickyBlock.offset - (initBlock.offset + initBlock.length); + const leadSpace = stickyBlock.offset - initBlock.offset; cells.push( , );