@@ -6,16 +6,19 @@ import TimerMixin from 'react-timer-mixin'
6
6
7
7
const _KAM_DEFAULT_TAB_BAR_HEIGHT = 49
8
8
const _KAM_KEYBOARD_OPENING_TIME = 250
9
+ const _KAM_EXTRA_HEIGHT = 75
9
10
10
11
const KeyboardAwareMixin = {
11
12
mixins : [ TimerMixin ] ,
12
13
propTypes : {
13
- enableAutoAutomaticScroll : PropTypes . bool
14
+ enableAutoAutomaticScroll : PropTypes . bool ,
15
+ extraHeight : PropTypes . number ,
14
16
} ,
15
17
16
18
getDefaultProps : function ( ) {
17
19
return {
18
20
enableAutoAutomaticScroll : true ,
21
+ extraHeight : _KAM_EXTRA_HEIGHT ,
19
22
}
20
23
} ,
21
24
@@ -87,7 +90,7 @@ const KeyboardAwareMixin = {
87
90
/**
88
91
* @param extraHeight: takes an extra height in consideration.
89
92
*/
90
- scrollToFocusedInput: function ( reactNode : Object , extraHeight : number = _KAM_DEFAULT_TAB_BAR_HEIGHT ) {
93
+ scrollToFocusedInput: function ( reactNode : Object , extraHeight : number = this . props . extraHeight ) {
91
94
const scrollView = this . refs . _rnkasv_keyboardView . getScrollResponder ( )
92
95
this . setTimeout ( ( ) => {
93
96
scrollView . scrollResponderScrollNativeHandleToKeyboard (
@@ -96,7 +99,7 @@ const KeyboardAwareMixin = {
96
99
} , _KAM_KEYBOARD_OPENING_TIME )
97
100
} ,
98
101
99
- scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number = _KAM_DEFAULT_TAB_BAR_HEIGHT ) {
102
+ scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number = this . props . extraHeight ) {
100
103
const reactNode = ReactNative . findNodeHandle ( nodeID )
101
104
this . scrollToFocusedInput ( reactNode , extraHeight )
102
105
} ,
0 commit comments