@@ -6,16 +6,19 @@ import TimerMixin from 'react-timer-mixin'
66
77const _KAM_DEFAULT_TAB_BAR_HEIGHT = 49
88const _KAM_KEYBOARD_OPENING_TIME = 250
9+ const _KAM_EXTRA_HEIGHT = 75
910
1011const KeyboardAwareMixin = {
1112 mixins : [ TimerMixin ] ,
1213 propTypes : {
13- enableAutoAutomaticScroll : PropTypes . bool
14+ enableAutoAutomaticScroll : PropTypes . bool ,
15+ extraHeight : PropTypes . number ,
1416 } ,
1517
1618 getDefaultProps : function ( ) {
1719 return {
1820 enableAutoAutomaticScroll : true ,
21+ extraHeight : _KAM_EXTRA_HEIGHT ,
1922 }
2023 } ,
2124
@@ -87,7 +90,7 @@ const KeyboardAwareMixin = {
8790 /**
8891 * @param extraHeight: takes an extra height in consideration.
8992 */
90- scrollToFocusedInput: function ( reactNode : Object , extraHeight : number = _KAM_DEFAULT_TAB_BAR_HEIGHT ) {
93+ scrollToFocusedInput: function ( reactNode : Object , extraHeight : number = this . props . extraHeight ) {
9194 const scrollView = this . refs . _rnkasv_keyboardView . getScrollResponder ( )
9295 this . setTimeout ( ( ) => {
9396 scrollView . scrollResponderScrollNativeHandleToKeyboard (
@@ -96,7 +99,7 @@ const KeyboardAwareMixin = {
9699 } , _KAM_KEYBOARD_OPENING_TIME )
97100 } ,
98101
99- scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number = _KAM_DEFAULT_TAB_BAR_HEIGHT ) {
102+ scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number = this . props . extraHeight ) {
100103 const reactNode = ReactNative . findNodeHandle ( nodeID )
101104 this . scrollToFocusedInput ( reactNode , extraHeight )
102105 } ,
0 commit comments