Permalink
Browse files

VirtualizedList: Fix spacer size calculation (#18105)

Summary:
See #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: #18105

Differential Revision: D8382122

Pulled By: sahrens

fbshipit-source-id: 9421351469e8684bc61438605abbd9988b664c29
  • Loading branch information...
rbrosboel authored and facebook-github-bot committed Jul 20, 2018
1 parent 7091f15 commit e0c73633cfc0a62df9d39991b0df65fa5875609a
Showing with 1 addition and 2 deletions.
  1. +1 −2 Libraries/Lists/VirtualizedList.js
@@ -805,8 +805,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
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(
<View key="$sticky_lead" style={{[spacerKey]: leadSpace}} />,
);

0 comments on commit e0c7363

Please sign in to comment.