From 398e9754cdf03fe7cbcf970eb793bbb3b5195f9e Mon Sep 17 00:00:00 2001 From: Christoph Nakazawa Date: Tue, 22 Jan 2019 07:22:08 -0800 Subject: [PATCH] Fixes #issue18098 SectionList scrollToLocation (#21577) Summary: Fixes #18098 Pull Request resolved: https://github.com/facebook/react-native/pull/21577 Differential Revision: D13761884 Pulled By: cpojer fbshipit-source-id: a096d69c589815d00754427fb575de0d8d0b595f --- Libraries/Lists/VirtualizedSectionList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 2e2256287fc604..e314871c4ee13a 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -9,6 +9,7 @@ */ 'use strict'; +const Platform = require('Platform'); const React = require('React'); const View = require('View'); const VirtualizedList = require('VirtualizedList'); @@ -145,7 +146,7 @@ class VirtualizedSectionList extends React.PureComponent< sectionIndex: number, viewPosition?: number, }) { - let index = params.itemIndex + 1; + let index = Platform.OS === 'ios' ? params.itemIndex : params.itemIndex - 1; for (let ii = 0; ii < params.sectionIndex; ii++) { index += this.props.sections[ii].data.length + 2; }