Skip to content

Commit

Permalink
do not render label elements when undedined
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed May 2, 2024
1 parent 123e216 commit b620926
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/components/src/form-token-field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,14 @@ export function FormTokenField( props: FormTokenFieldProps ) {
/* eslint-disable jsx-a11y/no-static-element-interactions */
return (
<div { ...tokenFieldProps }>
<StyledLabel
htmlFor={ `components-form-token-input-${ instanceId }` }
className="components-form-token-field__label"
>
{ label }
</StyledLabel>
{ label && (
<StyledLabel
htmlFor={ `components-form-token-input-${ instanceId }` }
className="components-form-token-field__label"
>
{ label }
</StyledLabel>
) }
<div
ref={ tokensAndInput }
className={ classes }
Expand Down

0 comments on commit b620926

Please sign in to comment.