[Docs] Improve ScrollView documentation
automaticallyAdjustContentInsets: PropTypes.bool, // true
contentInset: EdgeInsetsPropType, // zeros
contentOffset: PointPropType, // zeros
onScroll: PropTypes.func,
onScrollAnimationEnd: PropTypes.func,
scrollEnabled: PropTypes.bool, // true
scrollIndicatorInsets: EdgeInsetsPropType, // zeros
showsHorizontalScrollIndicator: PropTypes.bool,
showsVerticalScrollIndicator: PropTypes.bool,
style: StyleSheetPropType(ViewStylePropTypes),
scrollEventThrottle: PropTypes.number, // null
Also, when using onScroll, I receive this warning:
Warning: Don't set .props.onScroll of the React component <ScrollView />. Instead, specify the correct value when initially creating the element or use React.cloneElement to make a new element with updated props. The element was created by OrganizationProfileScreen.
Just based off of this
<ScrollView style={{backgroundColor: 'white', flex: 1, borderWidth: 0}} onScroll={this._onScroll}>
</ScrollView>
onScrollAnimationEnd doesn't seem to fire for horizontal scrolls
edit: need to use onMomentumScrollEnd - onScrollAnimationEnd refers to the incorrect event type and updating that does not fix it even
Might be useful to have a way to get the current contentOffset - just as we can access the contentSize
Note: this is a bit of a braindump right now from working with ScrollView, will cleanup when I'm done
:+1: I posted these issues a few weeks ago while working on the calendar. Was looking for confirmation that it wasn't working.
+1. I noticed other developers were using the following as well, which is not documented:
- onScrollBeginDrag
- onMomentumScrollEnd
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
This is a bit of a blocker. Can we have an estimate of when this will be looked into and fix will be released.
@facebook-github-bot-8 we are waiting
@sheki @stereodenis - you can upvote this on ProductPains - https://productpains.com/post/react-native/improve-scrollview-documentation/ - or if you are up for it, it would be great for you to have you look into the props and add some documentation yourself :)
After one year, onMomentumScrollEnd is still undocumented. Thanks for your investigations.
Thanks for onMomentumScrollEnd, ran into the same issue
I had the same issue. Thanks for this thread!
onMomentumScrollEnd was a life saver, this should really get added to the docs! Glad Google indexed this thread :)