react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Docs] Improve ScrollView documentation

Open brentvatne opened this issue 11 years ago • 14 comments

    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

brentvatne avatar May 26 '15 18:05 brentvatne

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>

brentvatne avatar May 26 '15 18:05 brentvatne

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

brentvatne avatar May 26 '15 21:05 brentvatne

Might be useful to have a way to get the current contentOffset - just as we can access the contentSize

brentvatne avatar May 26 '15 21:05 brentvatne

Note: this is a bit of a braindump right now from working with ScrollView, will cleanup when I'm done

brentvatne avatar May 27 '15 02:05 brentvatne

:+1: I posted these issues a few weeks ago while working on the calendar. Was looking for confirmation that it wasn't working.

christopherdro avatar May 27 '15 06:05 christopherdro

+1. I noticed other developers were using the following as well, which is not documented:

  • onScrollBeginDrag
  • onMomentumScrollEnd

TYRONEMICHAEL avatar May 29 '15 06:05 TYRONEMICHAEL

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.

ghost avatar Aug 05 '15 18:08 ghost

This is a bit of a blocker. Can we have an estimate of when this will be looked into and fix will be released.

sheki avatar Aug 16 '15 22:08 sheki

@facebook-github-bot-8 we are waiting

stereodenis avatar Dec 01 '15 17:12 stereodenis

@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 :)

brentvatne avatar Jan 03 '16 03:01 brentvatne

After one year, onMomentumScrollEnd is still undocumented. Thanks for your investigations.

drpiou avatar Oct 20 '16 09:10 drpiou

Thanks for onMomentumScrollEnd, ran into the same issue

gavinlynch avatar Oct 29 '16 05:10 gavinlynch

I had the same issue. Thanks for this thread!

lesniakania avatar Nov 30 '16 17:11 lesniakania

onMomentumScrollEnd was a life saver, this should really get added to the docs! Glad Google indexed this thread :)

pcottle avatar Jan 23 '17 16:01 pcottle