diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index ebd12dfad57dc7..841aaca87433fc 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -143,17 +143,18 @@ class VirtualizedSectionList< itemIndex: number, sectionIndex: number, viewPosition?: number, + viewOffset?: number, }) { let index = params.itemIndex; for (let i = 0; i < params.sectionIndex; i++) { index += this.props.getItemCount(this.props.sections[i].data) + 2; } - let viewOffset = 0; + let viewOffset = params.viewOffset || 0; if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { const frame = this._listRef._getFrameMetricsApprox( index - params.itemIndex, ); - viewOffset = frame.length; + viewOffset = viewOffset + frame.length; } const toIndexParams = { ...params,