From c725e96ea6cafbb3ab41dc749b40b26e642903e4 Mon Sep 17 00:00:00 2001 From: Robin Clowers Date: Sun, 20 Nov 2016 17:53:12 -0800 Subject: [PATCH] Add bounces prop --- README.md | 1 + SmartScrollView.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd8cd73..4a481fe 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ In wrapping around the ScrollView and using the TextInput to control keyboard we | contentInset | `{top: 0, left: 0, bottom: 0, right: 0}` | `object` | Set to the ScrollView contentInset prop | | onScroll | `() => {}` | `func` | Set to the ScrollView onScroll function. It will be called alongside our own | | onRefFocus | `()=>{}` | `func` | Gives back the 'ref' of the node whenever a smart component is focused | +| bounces | `()=>{}` | `bool` | Controls bouncing of the underlying ScrollView | #### Smart Component Props diff --git a/SmartScrollView.js b/SmartScrollView.js index fc42423..3cd81ba 100644 --- a/SmartScrollView.js +++ b/SmartScrollView.js @@ -157,7 +157,8 @@ class SmartScrollView extends Component { zoomScale, showsVerticalScrollIndicator, contentInset, - onScroll + onScroll, + bounces, } = this.props; let inputIndex = 0; const smartClone = (element, i) => { @@ -238,7 +239,7 @@ class SmartScrollView extends Component { zoomScale = { zoomScale } showsVerticalScrollIndicator = { showsVerticalScrollIndicator } keyboardShouldPersistTaps = { true } - bounces = { false } + bounces = { bounces } > {content} @@ -263,6 +264,7 @@ SmartScrollView.propTypes = { contentInset: PropTypes.object, onScroll: PropTypes.func, onRefFocus: PropTypes.func, + bounces: PropTypes.bool, }; SmartScrollView.defaultProps = {