@@ -7,7 +7,8 @@ import ReactNative, {
77  Platform , 
88  UIManager , 
99  TextInput , 
10-   findNodeHandle 
10+   findNodeHandle , 
11+   Animated 
1112}  from  'react-native' 
1213import  {  isIphoneX  }  from  'react-native-iphone-x-helper' 
1314
@@ -81,7 +82,6 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
8182    mountedComponent: boolean 
8283    handleOnScroll: Function 
8384    state: KeyboardAwareHOCState 
84- 
8585    static displayName  =  `KeyboardAware${ getDisplayName ( ScrollableComponent ) }  
8686
8787    static  propTypes  =  { 
@@ -382,15 +382,8 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
382382      } 
383383    } 
384384
385-     _onScroll  =  ( 
386-       e : SyntheticEvent < * >  &  {  nativeEvent : {  contentOffset : number  }  } 
387-     )  =>  { 
388-       this . _handleOnScroll ( e ) 
389-       this . props . onScroll  &&  this . props . onScroll ( e ) 
390-     } 
391- 
392385    render ( )  { 
393-       const  {  enableOnAndroid,  contentContainerStyle }  =  this . props 
386+       const  {  enableOnAndroid,  contentContainerStyle,  onScroll  }  =  this . props 
394387      let  newContentContainerStyle 
395388      if  ( Platform . OS  ===  'android'  &&  enableOnAndroid )  { 
396389        newContentContainerStyle =  [ ] . concat ( contentContainerStyle ) . concat ( { 
@@ -419,7 +412,7 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
419412          scrollToFocusedInput = { this . scrollToFocusedInput } 
420413          resetKeyboardSpace = { this . _resetKeyboardSpace } 
421414          handleOnScroll = { this . _handleOnScroll } 
422-           onScroll = { this . _onScroll } 
415+           onScroll = { Animated . forkEvent ( onScroll , this . _handleOnScroll ) } 
423416        /> 
424417      ) 
425418    } 
0 commit comments