fix: can not type `0.05` in `TextControl` (#10778)

This commit is contained in:
Shaoqing Hu 2020-09-04 03:11:34 +08:00 committed by GitHub
parent 70c6764780
commit 9bcb15091c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ export default class TextControl extends React.Component<TextControlProps> {
if (error) { if (error) {
errors.push(error); errors.push(error);
} else { } else {
value = value.match(/.*(\.)$/g) ? value : parseFloat(value); value = value.match(/.*(\.|0)$/g) ? value : parseFloat(value);
} }
} }
if (value !== '' && this.props.isInt) { if (value !== '' && this.props.isInt) {