refactor: make code more robust

This commit is contained in:
Benjy Cui 2016-01-25 15:00:03 +08:00
parent ecc2b6fe8c
commit 366edc023a
2 changed files with 2 additions and 2 deletions

View File

@ -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';
} }
} }

View File

@ -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();