@@ -14,6 +14,7 @@ const KeyboardAwareMixin = {
14
14
mixins : [ TimerMixin ] ,
15
15
propTypes : {
16
16
enableAutoAutomaticScroll : PropTypes . bool ,
17
+ keyboardOpeningTime : PropTypes . number ,
17
18
extraHeight : PropTypes . number ,
18
19
extraScrollHeight : PropTypes . number ,
19
20
enableResetScrollToCoords : PropTypes . bool ,
@@ -25,6 +26,7 @@ const KeyboardAwareMixin = {
25
26
extraHeight : _KAM_EXTRA_HEIGHT ,
26
27
extraScrollHeight : 0 ,
27
28
enableResetScrollToCoords : true ,
29
+ keyboardOpeningTime : _KAM_KEYBOARD_OPENING_TIME ,
28
30
}
29
31
} ,
30
32
@@ -130,26 +132,37 @@ const KeyboardAwareMixin = {
130
132
} ,
131
133
132
134
/**
135
+ * @param keyboardOpeningTime: takes a different keyboardOpeningTime in consideration.
133
136
* @param extraHeight: takes an extra height in consideration.
134
137
*/
135
- scrollToFocusedInput: function ( reactNode : Object , extraHeight : number ) {
138
+ scrollToFocusedInput : function ( reactNode : Object , extraHeight : number , keyboardOpeningTime : number ) {
136
139
if ( extraHeight === undefined ) {
137
140
extraHeight = this . props . extraHeight ;
138
141
}
142
+
143
+ if ( keyboardOpeningTime === undefined ) {
144
+ keyboardOpeningTime = this . props . keyboardOpeningTime ;
145
+ }
146
+
139
147
this . setTimeout ( ( ) => {
140
148
const responder = this . getScrollResponder ( ) ;
141
149
responder && responder . scrollResponderScrollNativeHandleToKeyboard (
142
150
reactNode , extraHeight , true
143
151
)
144
- } , _KAM_KEYBOARD_OPENING_TIME )
152
+ } , keyboardOpeningTime )
145
153
} ,
146
154
147
- scrollToFocusedInputWithNodeHandle : function ( nodeID : number , extraHeight : number ) {
155
+ scrollToFocusedInputWithNodeHandle: function ( nodeID : number , extraHeight : number , keyboardOpeningTime : number ) {
148
156
if ( extraHeight === undefined ) {
149
157
extraHeight = this . props . extraHeight ;
150
158
}
159
+
160
+ if ( keyboardOpeningTime === undefined ) {
161
+ keyboardOpeningTime = this . props . keyboardOpeningTime ;
162
+ }
163
+
151
164
const reactNode = ReactNative . findNodeHandle ( nodeID )
152
- this . scrollToFocusedInput ( reactNode , extraHeight + this . props . extraScrollHeight )
165
+ this . scrollToFocusedInput ( reactNode , extraHeight + this . props . extraScrollHeight , keyboardOpeningTime )
153
166
} ,
154
167
155
168
position : { x : 0 , y : 0 } ,
0 commit comments