fix: should not set required to label #985

This commit is contained in:
Benjy Cui 2016-02-02 19:08:17 +08:00
parent ce9e377a38
commit b42fb9f189
2 changed files with 7 additions and 2 deletions

View File

@ -114,8 +114,13 @@ class FormItem extends React.Component {
this.isRequired() :
props.required;
const className = classNames({
[this._getLayoutClass(labelCol)]: true,
required: required,
});
return props.label ? (
<label htmlFor={props.id || this.getId()} className={this._getLayoutClass(labelCol)} required={required} key="label">
<label htmlFor={props.id || this.getId()} className={className} key="label">
{props.label}
</label>
) : null;

View File

@ -4,7 +4,7 @@
label {
position: relative;
&[required]:before {
&.required:before {
display: inline-block;
margin-right: 4px;
content: "*";