@@ -23,7 +23,7 @@ export type KeyboardAwareHOCProps = {
23
23
y : number
24
24
} ,
25
25
enableResetScrollToCoords ?: boolean ,
26
- enableAutoAutomaticScroll ?: boolean ,
26
+ enableAutomaticScroll ?: boolean ,
27
27
extraHeight ?: number ,
28
28
extraScrollHeight ?: number ,
29
29
keyboardOpeningTime ?: number ,
@@ -40,7 +40,7 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
40
40
return class extends React . Component <
41
41
KeyboardAwareHOCProps ,
42
42
KeyboardAwareHOCState
43
- > implements KeyboardAwareInterface {
43
+ > implements KeyboardAwareInterface {
44
44
_rnkasv_keyboardView : any
45
45
keyboardWillShowEvent : ?Function
46
46
keyboardWillHideEvent : ?Function
@@ -58,7 +58,7 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
58
58
y : PropTypes . number . isRequired
59
59
} ) ,
60
60
enableResetScrollToCoords : PropTypes . bool ,
61
- enableAutoAutomaticScroll : PropTypes . bool ,
61
+ enableAutomaticScroll : PropTypes . bool ,
62
62
extraHeight : PropTypes . number ,
63
63
extraScrollHeight : PropTypes . number ,
64
64
keyboardOpeningTime : PropTypes . number ,
@@ -69,7 +69,7 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
69
69
}
70
70
71
71
static defaultProps = {
72
- enableAutoAutomaticScroll : true ,
72
+ enableAutomaticScroll : true ,
73
73
extraHeight : _KAM_EXTRA_HEIGHT ,
74
74
extraScrollHeight : 0 ,
75
75
enableResetScrollToCoords : true ,
@@ -182,14 +182,13 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
182
182
183
183
// Keyboard actions
184
184
_updateKeyboardSpace = ( frames : Object ) => {
185
- let keyboardSpace : number =
186
- frames . endCoordinates . height + this . props . extraScrollHeight
187
- if ( this . props . viewIsInsideTabBar ) {
188
- keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
189
- }
190
- this . setState ( { keyboardSpace } )
191
185
// Automatically scroll to focused TextInput
192
- if ( this . props . enableAutoAutomaticScroll ) {
186
+ if ( this . props . enableAutomaticScroll ) {
187
+ let keyboardSpace : number = frames . endCoordinates . height + this . props . extraScrollHeight
188
+ if ( this . props . viewIsInsideTabBar ) {
189
+ keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
190
+ }
191
+ this . setState ( { keyboardSpace } )
193
192
const currentlyFocusedField = TextInput . State . currentlyFocusedField ( )
194
193
const responder = this . getScrollResponder ( )
195
194
if ( ! currentlyFocusedField || ! responder ) {
0 commit comments