diff --git a/src/components/GroupedList/GroupedList.js b/src/components/GroupedList/GroupedList.js index abff3ccf..e7fda274 100644 --- a/src/components/GroupedList/GroupedList.js +++ b/src/components/GroupedList/GroupedList.js @@ -80,9 +80,10 @@ class GroupedList extends React.PureComponent { if (this.sectionList) { this.sectionList.scrollToLocation({ - viewOffset: this.props.stickySectionHeadersEnabled - ? this.sectionHeadersHeights[sections[index]] - : 0, + viewOffset: + this.props.stickySectionHeadersEnabled !== false + ? this.sectionHeadersHeights[sections[index]] + : 0, sectionIndex: index, itemIndex: 0, animated: false, diff --git a/src/components/GroupedList/Sections.js b/src/components/GroupedList/Sections.js index f23c3af7..006b883b 100644 --- a/src/components/GroupedList/Sections.js +++ b/src/components/GroupedList/Sections.js @@ -71,11 +71,11 @@ class Sections extends PureComponent { return; } - const sectionIdx = Math.floor( + const sectionIdx = Math.round( (pageY - this.sectionsY) * this.props.items.length / this.sectionsHeight ); if ( - sectionIdx > 0 && + sectionIdx >= 0 && sectionIdx < this.props.items.length && this.currentSectionIdx !== sectionIdx ) {