Skip to content

Commit f66e8eb

Browse files
cpojerfacebook-github-bot
authored andcommitted
Fixes #issue18098 SectionList scrollToLocation (#21577)
Summary: Fixes #18098 Pull Request resolved: #21577 Differential Revision: D13761884 Pulled By: cpojer fbshipit-source-id: a096d69c589815d00754427fb575de0d8d0b595f
1 parent 01f1780 commit f66e8eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Libraries/Lists/VirtualizedSectionList.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
'use strict';
1111

12+
const Platform = require('Platform');
1213
const React = require('React');
1314
const View = require('View');
1415
const VirtualizedList = require('VirtualizedList');
@@ -145,7 +146,7 @@ class VirtualizedSectionList<SectionT: SectionBase> extends React.PureComponent<
145146
sectionIndex: number,
146147
viewPosition?: number,
147148
}) {
148-
let index = params.itemIndex + 1;
149+
let index = Platform.OS === 'ios' ? params.itemIndex : params.itemIndex - 1;
149150
for (let ii = 0; ii < params.sectionIndex; ii++) {
150151
index += this.props.sections[ii].data.length + 2;
151152
}

0 commit comments

Comments
 (0)