Skip to content

Commit e0c7363

Browse files
rbrosboelfacebook-github-bot
authored andcommitted
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
1 parent 7091f15 commit e0c7363

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Libraries/Lists/VirtualizedList.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
805805
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
806806
const initBlock = this._getFrameMetricsApprox(lastInitialIndex);
807807
const stickyBlock = this._getFrameMetricsApprox(ii);
808-
const leadSpace =
809-
stickyBlock.offset - (initBlock.offset + initBlock.length);
808+
const leadSpace = stickyBlock.offset - initBlock.offset;
810809
cells.push(
811810
<View key="$sticky_lead" style={{[spacerKey]: leadSpace}} />,
812811
);

0 commit comments

Comments
 (0)