@@ -14,6 +14,7 @@ const KeyboardAwareMixin = {
1414 mixins : [ TimerMixin ] ,
1515 propTypes : {
1616 enableAutoAutomaticScroll : PropTypes . bool ,
17+ keyboardOpeningTime : PropTypes . number ,
1718 extraHeight : PropTypes . number ,
1819 extraScrollHeight : PropTypes . number ,
1920 enableResetScrollToCoords : PropTypes . bool ,
@@ -25,6 +26,7 @@ const KeyboardAwareMixin = {
2526 extraHeight : _KAM_EXTRA_HEIGHT ,
2627 extraScrollHeight : 0 ,
2728 enableResetScrollToCoords : true ,
29+ keyboardOpeningTime : _KAM_KEYBOARD_OPENING_TIME ,
2830 }
2931 } ,
3032
@@ -130,26 +132,37 @@ const KeyboardAwareMixin = {
130132 } ,
131133
132134 /**
135+ * @param keyboardOpeningTime: takes a different keyboardOpeningTime in consideration.
133136 * @param extraHeight: takes an extra height in consideration.
134137 */
135- scrollToFocusedInput: function ( reactNode : Object , extraHeight : number ) {
138+ scrollToFocusedInput : function ( reactNode : Object , extraHeight : number , keyboardOpeningTime : number ) {
136139 if ( extraHeight === undefined ) {
137140 extraHeight = this . props . extraHeight ;
138141 }
142+
143+ if ( keyboardOpeningTime === undefined ) {
144+ keyboardOpeningTime = this . props . keyboardOpeningTime ;
145+ }
146+
139147 this . setTimeout ( ( ) => {
140148 const responder = this . getScrollResponder ( ) ;
141149 responder && responder . scrollResponderScrollNativeHandleToKeyboard (
142150 reactNode , extraHeight , true
143151 )
144- } , _KAM_KEYBOARD_OPENING_TIME )
152+ } , keyboardOpeningTime )
145153 } ,
146154
147- scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number ) {
155+ scrollToFocusedInputWithNodeHandle: function ( nodeID : number , extraHeight : number , keyboardOpeningTime : number ) {
148156 if ( extraHeight === undefined ) {
149157 extraHeight = this . props . extraHeight ;
150158 }
159+
160+ if ( keyboardOpeningTime === undefined ) {
161+ keyboardOpeningTime = this . props . keyboardOpeningTime ;
162+ }
163+
151164 const reactNode = ReactNative . findNodeHandle ( nodeID )
152- this . scrollToFocusedInput ( reactNode , extraHeight + this . props . extraScrollHeight )
165+ this . scrollToFocusedInput ( reactNode , extraHeight + this . props . extraScrollHeight , keyboardOpeningTime )
153166 } ,
154167
155168 position : { x : 0 , y : 0 } ,
0 commit comments