diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 90e560c608f1ed..ceb039ba2e9ec5 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -149,8 +149,16 @@ 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 = { ...params, + viewOffset, index, }; this._listRef.scrollToIndex(toIndexParams);