mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
fix: should not set required to label #985
This commit is contained in:
parent
ce9e377a38
commit
b42fb9f189
@ -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;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
label {
|
||||
position: relative;
|
||||
&[required]:before {
|
||||
&.required:before {
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
content: "*";
|
||||
|
Loading…
Reference in New Issue
Block a user