From 2f00cb05bd971d8e2b0e87748e416353f3ded87d Mon Sep 17 00:00:00 2001 From: James Ide Date: Tue, 31 Mar 2015 14:59:14 -0700 Subject: [PATCH] [ScrollView] Add "bounces" property to ScrollView propTypes Summary: The `bounces` property lets you disable rubber-banding. It was already exposed on the native side so this diff is just documenting it in JS. Closes https://github.com/facebook/react-native/pull/264 Github Author: James Ide Test Plan: Imported from GitHub, without a `Test Plan:` line. --- Libraries/Components/ScrollView/ScrollView.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index ba6a2c8b1..ff0ab9056 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -59,13 +59,20 @@ var ScrollView = React.createClass({ contentOffset: PointPropType, // zeros onScroll: PropTypes.func, onScrollAnimationEnd: PropTypes.func, - scrollEnabled: PropTypes.bool, // tre + scrollEnabled: PropTypes.bool, // true scrollIndicatorInsets: EdgeInsetsPropType, // zeros showsHorizontalScrollIndicator: PropTypes.bool, showsVerticalScrollIndicator: PropTypes.bool, style: StyleSheetPropType(ViewStylePropTypes), scrollEventThrottle: PropTypes.number, // null + /** + * When true, the scroll view bounces when it reaches the end of the + * content if the content is larger then the scroll view along the axis of + * the scroll direction. When false, it disables all bouncing even if + * the `alwaysBounce*` props are true. The default value is true. + */ + bounces: PropTypes.bool, /** * When true, the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default @@ -308,6 +315,7 @@ var validAttributes = { alwaysBounceHorizontal: true, alwaysBounceVertical: true, automaticallyAdjustContentInsets: true, + bounces: true, centerContent: true, contentInset: {diff: insetsDiffer}, contentOffset: {diff: pointsDiffer},