Skip to content

Commit

Permalink
Remove element when label is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
tfirdaus committed Dec 14, 2024
1 parent 9612011 commit 555290b
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions packages/kubrick/src/CheckboxGroup/CheckboxGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,27 @@ export const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(
aria-invalid={isInvalid}
ref={ref}
>
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
{label && (
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
)}
<CheckboxGroupContext.Provider value={state}>
<div
className={clsx({
Expand Down

0 comments on commit 555290b

Please sign in to comment.