fix empty string in inputNumber on letters
This commit is contained in:
parent
52b035e7b4
commit
036a3ac085
@ -15,10 +15,11 @@ const InputNumber = ({
|
||||
<AntInputNumber
|
||||
{...props}
|
||||
parser={value => {
|
||||
value = value.replace(/[^0-9.,]+/, '');
|
||||
if (value === '') {
|
||||
return 0;
|
||||
return '0';
|
||||
}
|
||||
return value.replace(/[^0-9.,]+/, '');
|
||||
return value;
|
||||
}}
|
||||
disabled={status === ElementStatus.Disabled}
|
||||
style={styles}
|
||||
|
||||
Reference in New Issue
Block a user