Skip to content

Commit

Permalink
Fix regression of VirtualizedList jumpy header (facebook#22025)
Browse files Browse the repository at this point in the history
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
  • Loading branch information
danilobuerger authored and erwamartin committed Feb 21, 2019
1 parent 41577ec commit 8a1f1f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,10 @@ 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;
const leadSpace =
stickyBlock.offset -
initBlock.offset -
(this.props.initialScrollIndex ? 0 : initBlock.length);
cells.push(
<View key="$sticky_lead" style={{[spacerKey]: leadSpace}} />,
);
Expand Down

0 comments on commit 8a1f1f1

Please sign in to comment.