File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ const KeyboardAwareMixin = {
3434 keyboardSpace : keyboardSpace ,
3535 } )
3636 // Automatically scroll to focused TextInput
37- const currentlyFocusedField = TextInput . State . currentlyFocusedField ( )
38- this . scrollToFocusedInputWithNodeHandle ( currentlyFocusedField )
37+ if ( this . props . enableAutoAutomaticScroll ) {
38+ const currentlyFocusedField = TextInput . State . currentlyFocusedField ( )
39+ this . scrollToFocusedInputWithNodeHandle ( currentlyFocusedField )
40+ }
3941 } ,
4042
4143 resetKeyboardSpace : function ( ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,15 @@ import { ScrollView } from 'react-native'
55import KeyboardAwareMixin from './KeyboardAwareMixin'
66
77const KeyboardAwareScrollView = React . createClass ( {
8+ getDefaultProps : function ( ) {
9+ return {
10+ enableAutoAutomaticScroll : true ,
11+ } ;
12+ } ,
813 propTypes : {
914 ...ScrollView . propTypes ,
1015 viewIsInsideTabBar : PropTypes . bool ,
16+ enableAutoAutomaticScroll : PropTypes . bool ,
1117 resetScrollToCoords : PropTypes . shape ( {
1218 x : PropTypes . number ,
1319 y : PropTypes . number ,
You can’t perform that action at this time.
0 commit comments