Skip to content

Commit

Permalink
Add proptypes for scrollview drag start & end handlers
Browse files Browse the repository at this point in the history
Summary:
`ScrollView` has a bunch of `onFoo` handlers for scrolling-related events, most of which have a proptype defined and are documented. However, `onScrollBeginDrag` and `onScrollEndDrag` do not currently have a proptype and are not currently documented (as noted at https://stackoverflow.com/a/41793747/1709587). It seems reasonable to bring consistency and to provide documentation of these otherwise hard-to-discover props.

I haven't added or run any tests, and don't plan to do so (beyond waiting and seeing that no existing checks fail in CircleCI).

I have also created a PR to update the documentation at facebook/react-native-website#99

*(None needed; this isn't a functionality change.)*
Closes #17368

Differential Revision: D6642695

Pulled By: TheSavior

fbshipit-source-id: fa40ed2ae6d5947a161b816a47441d8f5d4d9c4d
  • Loading branch information
ExplodingCabbage authored and facebook-github-bot committed Dec 28, 2017
1 parent d3b41e0 commit 52f350a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Libraries/Components/ScrollView/ScrollView.js
Expand Up @@ -256,6 +256,15 @@ const ScrollView = createReactClass({
* events can be controlled using the `scrollEventThrottle` prop.
*/
onScroll: PropTypes.func,
/**
* Called when the user begins to drag the scroll view.
*/
onScrollBeginDrag: PropTypes.func,
/**
* Called when the user stops dragging the scroll view and it either stops
* or begins to glide.
*/
onScrollEndDrag: PropTypes.func,
/**
* Called when scrollable content view of the ScrollView changes.
*
Expand Down

0 comments on commit 52f350a

Please sign in to comment.