From 366edc023adb92a9520479bb85476c87240b56ff Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Mon, 25 Jan 2016 15:00:03 +0800 Subject: [PATCH] refactor: make code more robust --- components/form/FormItem.jsx | 2 +- components/form/demo/validate-customized.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index 7268236699..65df9dd4f5 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -48,7 +48,7 @@ class FormItem extends React.Component { return 'validating'; } else if (!!getFieldError(field)) { return 'error'; - } else if (getFieldValue(field)) { + } else if (getFieldValue(field) !== undefined) { return 'success'; } } diff --git a/components/form/demo/validate-customized.md b/components/form/demo/validate-customized.md index 541bac1edd..9d89c5d40e 100644 --- a/components/form/demo/validate-customized.md +++ b/components/form/demo/validate-customized.md @@ -75,7 +75,7 @@ let Demo = React.createClass({ this.getPassStrenth(value, 'pass'); if (form.getFieldValue('pass')) { - form.validateFields(['rePass']); + form.validateFields(['rePass'], { force: true }); } callback();