Skip to content

Commit e4fd9ba

Browse files
danilobuergerfacebook-github-bot
authored andcommitted
Fix regression of VirtualizedList jumpy header (#22025)
Summary: Fixes #20956, #21361, #21198, #21468 Keeps the intended outcome of #18105 Pull Request resolved: #22025 Differential Revision: D13941915 Pulled By: cpojer fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
1 parent cca1cdf commit e4fd9ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Libraries/Lists/VirtualizedList.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,10 @@ class VirtualizedList extends React.PureComponent<Props, State> {
806806
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
807807
const initBlock = this._getFrameMetricsApprox(lastInitialIndex);
808808
const stickyBlock = this._getFrameMetricsApprox(ii);
809-
const leadSpace = stickyBlock.offset - initBlock.offset;
809+
const leadSpace =
810+
stickyBlock.offset -
811+
initBlock.offset -
812+
(this.props.initialScrollIndex ? 0 : initBlock.length);
810813
cells.push(
811814
<View key="$sticky_lead" style={{[spacerKey]: leadSpace}} />,
812815
);

0 commit comments

Comments
 (0)