Merge pull request #1211 from 2betop/master

Number 不要 onChange 非数字类型的值
This commit is contained in:
吴多益 2020-12-18 21:41:18 +08:00 committed by GitHub
commit c213298009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,10 @@ export default class NumberControl extends React.Component<NumberProps, any> {
handleChange(inputValue: any) {
const {classPrefix: ns, onChange, resetValue} = this.props;
if (inputValue && typeof inputValue !== 'number') {
return;
}
onChange(typeof inputValue === 'undefined' ? resetValue || '' : inputValue);
}