mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-01 14:59:35 +08:00
refactor: make code more robust
This commit is contained in:
parent
ecc2b6fe8c
commit
366edc023a
@ -48,7 +48,7 @@ class FormItem extends React.Component {
|
|||||||
return 'validating';
|
return 'validating';
|
||||||
} else if (!!getFieldError(field)) {
|
} else if (!!getFieldError(field)) {
|
||||||
return 'error';
|
return 'error';
|
||||||
} else if (getFieldValue(field)) {
|
} else if (getFieldValue(field) !== undefined) {
|
||||||
return 'success';
|
return 'success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ let Demo = React.createClass({
|
|||||||
this.getPassStrenth(value, 'pass');
|
this.getPassStrenth(value, 'pass');
|
||||||
|
|
||||||
if (form.getFieldValue('pass')) {
|
if (form.getFieldValue('pass')) {
|
||||||
form.validateFields(['rePass']);
|
form.validateFields(['rePass'], { force: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
|
Loading…
Reference in New Issue
Block a user