Skip to content

Commit 52f350a

Browse files
Add proptypes for scrollview drag start & end handlers
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 facebook#17368 Differential Revision: D6642695 Pulled By: TheSavior fbshipit-source-id: fa40ed2ae6d5947a161b816a47441d8f5d4d9c4d
1 parent d3b41e0 commit 52f350a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Libraries/Components/ScrollView/ScrollView.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ const ScrollView = createReactClass({
256256
* events can be controlled using the `scrollEventThrottle` prop.
257257
*/
258258
onScroll: PropTypes.func,
259+
/**
260+
* Called when the user begins to drag the scroll view.
261+
*/
262+
onScrollBeginDrag: PropTypes.func,
263+
/**
264+
* Called when the user stops dragging the scroll view and it either stops
265+
* or begins to glide.
266+
*/
267+
onScrollEndDrag: PropTypes.func,
259268
/**
260269
* Called when scrollable content view of the ScrollView changes.
261270
*

0 commit comments

Comments
 (0)