File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -273,12 +273,26 @@ function KeyboardAwareHOC(
273
273
274
274
scrollToPosition = ( x : number , y : number , animated : boolean = true ) => {
275
275
const responder = this . getScrollResponder ( )
276
- responder && responder . scrollResponderScrollTo ( { x, y, animated } )
276
+ if ( ! responder ) return ;
277
+ if ( responder . scrollResponderScrollTo ) {
278
+ // React Native < 0.65
279
+ responder . scrollResponderScrollTo ( { x, y, animated } )
280
+ } else if ( responder . scrollTo ) {
281
+ // React Native >= 0.65
282
+ responder . scrollTo ( { x, y, animated } )
283
+ }
277
284
}
278
285
279
286
scrollToEnd = ( animated ? : boolean = true ) => {
280
287
const responder = this . getScrollResponder ( )
281
- responder && responder . scrollResponderScrollToEnd ( { animated } )
288
+ if ( ! responder ) return ;
289
+ if ( responder . scrollResponderScrollToEnd ) {
290
+ // React Native < 0.65
291
+ responder . scrollResponderScrollToEnd ( { animated } )
292
+ } else if ( responder . scrollToEnd ) {
293
+ // React Native >= 0.65
294
+ responder . scrollToEnd ( { animated } )
295
+ }
282
296
}
283
297
284
298
scrollForExtraHeightOnAndroid = ( extraHeight : number ) => {
You can’t perform that action at this time.
0 commit comments