File tree Expand file tree Collapse file tree 3 files changed +32
-26
lines changed Expand file tree Collapse file tree 3 files changed +32
-26
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change @@ -14,15 +14,17 @@ const Text = React.forwardRef(
1414 ref = { ref }
1515 >
1616 < input { ...rest } id = { id } required = { required } type = "text" />
17- < label
18- className = { classnames ( {
19- hxOptional : optional ,
20- hxRequired : required ,
21- } ) }
22- htmlFor = { id }
23- >
24- { label }
25- </ label >
17+ { label && (
18+ < label
19+ className = { classnames ( {
20+ hxOptional : optional ,
21+ hxRequired : required ,
22+ } ) }
23+ htmlFor = { id }
24+ >
25+ { label }
26+ </ label >
27+ ) }
2628 { prefix && < span className = "hxPrefix" > { prefix } </ span > }
2729 { suffix && < span className = "hxSuffix" > { suffix } </ span > }
2830 { children }
Original file line number Diff line number Diff line change @@ -14,15 +14,17 @@ const TextArea = React.forwardRef(
1414 ref = { ref }
1515 >
1616 < textarea { ...rest } id = { id } required = { required } disabled = { disabled } />
17- < label
18- className = { classnames ( {
19- hxOptional : optional ,
20- hxRequired : required ,
21- } ) }
22- htmlFor = { id }
23- >
24- { label }
25- </ label >
17+ { label && (
18+ < label
19+ className = { classnames ( {
20+ hxOptional : optional ,
21+ hxRequired : required ,
22+ } ) }
23+ htmlFor = { id }
24+ >
25+ { label }
26+ </ label >
27+ ) }
2628 { children }
2729 </ hx-textarea-control >
2830 ) ;
You can’t perform that action at this time.
0 commit comments