diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index ea615d236..f95c86733 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -325,7 +325,9 @@ class FlatList extends React.PureComponent, vo } /** - * Scroll to a specific content pixel offset, like a normal `ScrollView`. + * Scroll to a specific content pixel offset in the list. + * + * Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList */ scrollToOffset(params: {animated?: ?boolean, offset: number}) { this._listRef.scrollToOffset(params); diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 68aefe40e..936e748b9 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -238,6 +238,16 @@ class VirtualizedList extends React.PureComponent { } } + /** + * Scroll to a specific content pixel offset in the list. + * + * Param `offset` expects the offset to scroll to. + * In case of `horizontal` is true, the offset is the x-value, + * in any other case the offset is the y-value. + * + * Param `animated` (`true` by default) defines whether the list + * should do an animation while scrolling. + */ scrollToOffset(params: {animated?: ?boolean, offset: number}) { const {animated, offset} = params; this._scrollRef.scrollTo(