Skip to content

Commit

Permalink
Fix regression of VirtualizedList jumpy header
Browse files Browse the repository at this point in the history
  • Loading branch information
danilobuerger authored Oct 30, 2018
1 parent 31bb551 commit e801d7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,9 @@ 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 e801d7b

Please sign in to comment.