fix: number field reported error when clear data (#2561)
This commit is contained in:
parent
904d7ee87b
commit
9c22aebaff
@ -13,7 +13,7 @@ export const InputNumber: ComposedInputNumber = connect((props) => {
|
||||
const { onChange, ...others } = props;
|
||||
const handleChange = (v) => {
|
||||
const result = parseFloat(v);
|
||||
onChange(Number.isNaN(result) ? '' : result);
|
||||
onChange(Number.isNaN(result) ? null : result);
|
||||
};
|
||||
return <AntdNumber onChange={handleChange} {...others} />;
|
||||
}, mapReadPretty(ReadPretty));
|
||||
|
Loading…
Reference in New Issue
Block a user