@@ -123,11 +123,8 @@ const ScrollIntoViewDefaultOptions: KeyboardAwareHOCOptions = {
123
123
// getNode() permit to support Animated.ScrollView automatically
124
124
// see https://github.com/facebook/react-native/issues/19650
125
125
// see https://stackoverflow.com/questions/42051368/scrollto-is-undefined-on-animated-scrollview/48786374
126
- if ( ref . getNode ) {
127
- return ref . getNode ( )
128
- } else {
129
- return ref
130
- }
126
+ // see https://github.com/facebook/react-native/commit/66e72bb4e00aafbcb9f450ed5db261d98f99f82a
127
+ return ref
131
128
}
132
129
}
133
130
@@ -241,12 +238,12 @@ function KeyboardAwareHOC(
241
238
242
239
scrollToPosition = ( x : number , y : number , animated : boolean = true ) => {
243
240
const responder = this . getScrollResponder ( )
244
- responder && responder . scrollResponderScrollTo ( { x, y, animated } )
241
+ responder && responder . scrollTo ( { x, y, animated } )
245
242
}
246
243
247
244
scrollToEnd = ( animated ? : boolean = true ) => {
248
245
const responder = this . getScrollResponder ( )
249
- responder && responder . scrollResponderScrollToEnd ( { animated } )
246
+ responder && responder . scrollToEnd ( { animated } )
250
247
}
251
248
252
249
scrollForExtraHeightOnAndroid = ( extraHeight : number ) => {
@@ -339,7 +336,7 @@ function KeyboardAwareHOC(
339
336
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
340
337
}
341
338
this . setState ( { keyboardSpace } )
342
- const currentlyFocusedField = TextInput . State . currentlyFocusedInput ? findNodeHandle ( TextInput . State . currentlyFocusedInput ( ) ) : TextInput . State . currentlyFocusedField ( )
339
+ const currentlyFocusedField = findNodeHandle ( TextInput . State . currentlyFocusedInput ( ) )
343
340
const responder = this . getScrollResponder ( )
344
341
if ( ! currentlyFocusedField || ! responder ) {
345
342
return
@@ -462,7 +459,7 @@ function KeyboardAwareHOC(
462
459
}
463
460
464
461
update = ( ) => {
465
- const currentlyFocusedField = TextInput . State . currentlyFocusedInput ? findNodeHandle ( TextInput . State . currentlyFocusedInput ( ) ) : TextInput . State . currentlyFocusedField ( )
462
+ const currentlyFocusedField = findNodeHandle ( TextInput . State . currentlyFocusedInput ( ) )
466
463
const responder = this . getScrollResponder ( )
467
464
468
465
if ( ! currentlyFocusedField || ! responder ) {
0 commit comments