Yes
Yes
react-native -v:node -v:npm -v:Then, specify:
<FlatList />, in order to have access to scrollToOffset functionContent of the FlatList should be scrolled to provided y position
Content of the FlatList is always scrolled to y = 0
Try to scroll to the header and then let go. this.onScrollEnd should scroll back to y = 100, but instead the content is scrolled to y = 0
It's not a bug - you need to use the offset key, not y.
FlatList infers it to either x or y based on the horizontal prop.
Fix based on your example:
this.flatList.scrollToOffset({
offset: headerHeight,
animated: true
})
http://facebook.github.io/react-native/releases/0.46/docs/virtualizedlist.html#scrolltooffset
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
@DriesVS I used same code but it getting error as this.flatList.scrollToOffset is not a function. Am I missing something ?
this.flatList.scrollToOffset({
offset: headerHeight,
animated: true
})
I gave refs also in the AnimatedFlatList
Most helpful comment
It's not a bug - you need to use the offset key, not y.
FlatList infers it to either x or y based on the horizontal prop.
Fix based on your example:
http://facebook.github.io/react-native/releases/0.46/docs/virtualizedlist.html#scrolltooffset