File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
2
- import React from 'react' ;
2
+ import React , { PropTypes } from 'react' ;
3
3
4
4
import {
5
5
ListView
@@ -21,7 +21,10 @@ export default class KeyboardAwareListView extends KeyboardAwareBase {
21
21
this . _onKeyboardAwareViewLayout ( layoutEvent . nativeEvent . layout ) ;
22
22
} }
23
23
onScroll = { ( event ) => {
24
- this . _onKeyboardAwareViewScroll ( event . nativeEvent . contentOffset )
24
+ this . _onKeyboardAwareViewScroll ( event . nativeEvent . contentOffset ) ;
25
+ if ( this . props . onScroll ) {
26
+ this . props . onScroll ( event ) ;
27
+ }
25
28
} }
26
29
onContentSizeChange = { ( ) => {
27
30
this . _updateKeyboardAwareViewContentSize ( ) ;
@@ -31,3 +34,7 @@ export default class KeyboardAwareListView extends KeyboardAwareBase {
31
34
) ;
32
35
}
33
36
}
37
+
38
+ KeyboardAwareListView . propTypes = {
39
+ onScroll : PropTypes . func
40
+ } ;
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ export default class KeyboardAwareScrollView extends KeyboardAwareBase {
18
18
this . _onKeyboardAwareViewLayout ( layoutEvent . nativeEvent . layout ) ;
19
19
} }
20
20
onScroll = { ( event ) => {
21
- this . _onKeyboardAwareViewScroll ( event . nativeEvent . contentOffset )
21
+ this . _onKeyboardAwareViewScroll ( event . nativeEvent . contentOffset ) ;
22
+ if ( this . props . onScroll ) {
23
+ this . props . onScroll ( event ) ;
24
+ }
22
25
} }
23
26
onContentSizeChange = { ( ) => {
24
27
this . _updateKeyboardAwareViewContentSize ( ) ;
@@ -30,7 +33,8 @@ export default class KeyboardAwareScrollView extends KeyboardAwareBase {
30
33
}
31
34
32
35
KeyboardAwareScrollView . propTypes = {
33
- getTextInputRefs : PropTypes . func
36
+ getTextInputRefs : PropTypes . func ,
37
+ onScroll : PropTypes . func
34
38
} ;
35
39
KeyboardAwareScrollView . defaultProps = {
36
40
getTextInputRefs : ( ) => {
You can’t perform that action at this time.
0 commit comments