fix empty string in inputNumber on letters

This commit is contained in:
Chika 2020-12-16 19:50:54 +03:00
parent 52b035e7b4
commit 036a3ac085

View File

@ -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}