We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eef1121 commit e893e64Copy full SHA for e893e64
src/components/form/index.jsx
@@ -469,7 +469,7 @@ function getFormItemComponent(that) {
469
});
470
}
471
onChangeOrBlurEvent = (e, shouldValidate) => {
472
- const { noFormItem, type } = this.props;
+ const { noFormItem, type, required } = this.props;
473
let value;
474
if (e === undefined) {
475
value = undefined;
@@ -490,6 +490,11 @@ function getFormItemComponent(that) {
490
value = '';
491
492
493
+ if (type === 'input-number') {
494
+ if ((value === '' || value === undefined) && required) {
495
+ value = 0;
496
+ }
497
498
if (!noFormItem && shouldValidate) {
499
this.validateField(this.name, value, this.props.rules);
500
} else {
0 commit comments