File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,18 @@ class ViewPager extends React.Component {
5757 keyboardDismissMode : PropTypes . oneOf ( [
5858 'none' , // default
5959 'on-drag'
60- ] )
60+ ] ) ,
61+
62+ /**
63+ * When false, the content does not scroll.
64+ * The default value is true.
65+ */
66+ scrollEnabled : PropTypes . bool
6167 }
6268
6369 static defaultProps = {
64- initialPage : 0
70+ initialPage : 0 ,
71+ scrollEnabled : true
6572 }
6673
6774 state = {
@@ -88,7 +95,7 @@ class ViewPager extends React.Component {
8895 // });
8996 // });
9097
91- this . _panResponder = PanResponder . create ( {
98+ this . _panResponder = this . props . scrollEnabled && PanResponder . create ( {
9299 onStartShouldSetResponder : ( ) => true ,
93100 onMoveShouldSetPanResponder : this . _shouldSetPanResponder ,
94101 onPanResponderGrant : ( ) => { } ,
You can’t perform that action at this time.
0 commit comments