Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Do not render FormTokenField label when not defined #61336

Merged
merged 8 commits into from
May 8, 2024
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
Loading