You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -199,7 +201,7 @@ class InputSpinner extends Component {
199
201
if(this.maxReached(num)){
200
202
if(this.maxReached(num)){
201
203
parsedNum=this.state.max;
202
-
if(!isEmpty(value)){
204
+
if(!isEmptyValue){
203
205
this.maxTimer=this._debounceSetMax();
204
206
}
205
207
if(this.props.onMax){
@@ -208,34 +210,37 @@ class InputSpinner extends Component {
208
210
}
209
211
}
210
212
}else{
211
-
if(!isEmpty(value)&&!this.isEmptied()){
212
-
parsedNum=this.state.min;
213
+
if(!isEmptyValue){
213
214
this.minTimer=this._debounceSetMin();
214
-
}elseif(this.isEmptied()){
215
-
parsedNum=null;
215
+
}
216
+
217
+
if(isEmptyValue&&this.isEmptied()){
218
+
num=parsedNum=null;
216
219
}else{
217
220
parsedNum=this.state.min;
218
221
}
222
+
219
223
if(this.props.onMin){
220
224
this.props.onMin(parsedNum);
221
225
}
222
226
}
223
227
224
-
if(isEmpty(value)&&this.isEmptied()){
225
-
parsedNum=value;
228
+
if(isEmptyValue&&this.isEmptied()){
229
+
num=parsedNum=null;
226
230
}
227
231
228
-
if(current_value!==num&&this.props.onChange){
232
+
if(this.state.value!==num&&this.props.onChange){
229
233
constres=awaitthis.props.onChange(parsedNum);
230
-
if(!isEmpty(value)){
234
+
if(!isEmptyValue){
231
235
if(res===false){
232
236
return;
233
237
}elseif(isNumeric(res)){
234
238
num=this.parseNum(res);
235
239
}
236
240
}
237
241
}
238
-
if(!isEmpty(value)){
242
+
243
+
if(!isEmptyValue){
239
244
this.setState({value: num});
240
245
}else{
241
246
this.setState({value: value});
@@ -435,22 +440,9 @@ class InputSpinner extends Component {
435
440
* @private
436
441
*/
437
442
_getHoldChangeInterval(){
438
-
constMIN_HOLD_CHANGE_INTERVAL=10;// the minimum time interval between increases or decreases in value when holding a button
439
-
constHOLD_CHANGE_ACCELERATION_FACTOR=this.props.acceleration;// a factor that controls how fast the speed of the change in value will accelerate while a button is held
440
-
constHOLD_CHANGE_ACCELERATION_DELAY=this.props.accelerationDelay;// how long to wait after a button is being held before the acceleration of it speed going through values starts
441
-
constTIME_HOLDING_BUTTON_FOR_MIN_CHANGE_INTERVAL=
442
-
(Math.exp(MIN_HOLD_CHANGE_INTERVAL/-1)+
443
-
HOLD_CHANGE_ACCELERATION_DELAY)/
444
-
HOLD_CHANGE_ACCELERATION_FACTOR;
445
-
constHOLD_TIME=this._getHoldTime();// time on hold in ms
0 commit comments