diff --git a/src/core/RecyclerListView.tsx b/src/core/RecyclerListView.tsx index b3cbb387..1ee6ccb7 100644 --- a/src/core/RecyclerListView.tsx +++ b/src/core/RecyclerListView.tsx @@ -242,6 +242,33 @@ export default class RecyclerListView
mainAxisListDimen || mainAxisLayoutPos < currentScrollOffset || mainAxisLayoutPos > screenEndPos) { + this.scrollToIndex(index); + } else { + const viewEndPos = mainAxisLayoutPos + mainAxisLayoutDimen; + if (viewEndPos > screenEndPos) { + const offset = viewEndPos - screenEndPos; + this.scrollToOffset(0, offset + currentScrollOffset, animate); + } + } + } + } + public scrollToItem(data: any, animate?: boolean): void { const count = this.props.dataProvider.getSize(); for (let i = 0; i < count; i++) {