Skip to content

Commit

Permalink
Adjust scrollToLocation when using sticky section headers
Browse files Browse the repository at this point in the history
  • Loading branch information
danilobuerger authored May 7, 2019
1 parent a5c57b4 commit d8eb28a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Libraries/Lists/VirtualizedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ class VirtualizedSectionList<
for (let i = 0; i < params.sectionIndex; i++) {
index += this.props.getItemCount(this.props.sections[i].data) + 2;
}
let viewOffset = 0;
if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) {
const frame = this._listRef._getFrameMetricsApprox(index - params.itemIndex);
viewOffset = frame.length;
}
const toIndexParams = {
viewOffset,
...params,
index,
};
Expand Down

0 comments on commit d8eb28a

Please sign in to comment.