Skip to content

Commit

Permalink
Fixes #issue18098 SectionList scrollToLocation (#21577)
Browse files Browse the repository at this point in the history
Summary:
Fixes #18098
Pull Request resolved: #21577

Differential Revision: D13761884

Pulled By: cpojer

fbshipit-source-id: a096d69c589815d00754427fb575de0d8d0b595f
  • Loading branch information
cpojer authored and facebook-github-bot committed Jan 22, 2019
1 parent 01f1780 commit f66e8eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Lists/VirtualizedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
'use strict';

const Platform = require('Platform');
const React = require('React');
const View = require('View');
const VirtualizedList = require('VirtualizedList');
Expand Down Expand Up @@ -145,7 +146,7 @@ class VirtualizedSectionList<SectionT: SectionBase> 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;
}
Expand Down

0 comments on commit f66e8eb

Please sign in to comment.