Commit b4cd392 1 parent d7b7d4a commit b4cd392 Copy full SHA for b4cd392
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -427,23 +427,23 @@ class NumberPicker extends React.Component {
427
427
return onDisabled ( e ) ;
428
428
}
429
429
430
- const value = this . state . value ;
430
+ let value = this . state . value ;
431
431
// 受控下,可能强制回填非法值
432
432
if ( isNaN ( value ) ) {
433
433
return ;
434
434
}
435
435
436
+ if ( value === '' && ! this . props . stringMode ) {
437
+ value = 0 ;
438
+ }
439
+
436
440
let val = this [ `${ type } Step` ] ( value ) ;
437
441
val = this . correctBoundary ( val ) ;
438
442
// 受控下,显示的值应为受控value
439
443
if ( ! ( 'value' in this . props ) ) {
440
444
this . setDisplayValue ( { displayValue : val } ) ;
441
445
}
442
446
443
- if ( ! this . props . stringMode ) {
444
- val = Number ( val ) ;
445
- }
446
-
447
447
this . setValue ( { value : val , e, triggerType : type } ) ;
448
448
}
449
449
You can’t perform that action at this time.
0 commit comments