Skip to content

Commit a483ca5

Browse files
committed
only show labels if they exist
1 parent 6a008d7 commit a483ca5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/PasswordText/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ const Password = React.forwardRef(
1111
ref={ref}
1212
>
1313
<input {...rest} id={id} required={required} placeholder={placeholder} type="password" />
14-
<label
15-
className={classnames({
16-
hxRequired: required,
17-
})}
18-
htmlFor={id}
19-
>
20-
{label}
21-
</label>
14+
{label && (
15+
<label
16+
className={classnames({
17+
hxRequired: required,
18+
})}
19+
htmlFor={id}
20+
>
21+
{label}
22+
</label>
23+
)}
2224
{children}
2325
</hx-password-control>
2426
);

0 commit comments

Comments
 (0)