fix: both of undefined and null means no input, close: #2959

This commit is contained in:
Benjy Cui 2016-09-10 14:28:40 +08:00
parent 2bd05aeb2b
commit 44d5fc6fd2
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ export default class FormItem extends React.Component<FormItemProps, any> {
return 'validating';
} else if (!!getFieldError(field)) {
return 'error';
} else if (getFieldValue(field) !== undefined) {
} else if (getFieldValue(field) !== undefined && getFieldValue(field) !== null) {
return 'success';
}
return '';

View File

@ -109,7 +109,7 @@ export default class Header extends React.Component {
const url = `/components/${pathSnippet}`;
const subtitle = meta.subtitle || meta.chinese;
return (
<Option value={url} key={url} data-label={`${(meta.title || meta.english).toLowerCase()} ${meta.subtitle || meta.chinese}`}>
<Option value={url} key={url} data-label={`${(meta.title || meta.english).toLowerCase()} ${subtitle || ''}`}>
<strong>{meta.title || meta.english}</strong>
{subtitle && <span className="ant-component-decs">{subtitle}</span>}
</Option>