Skip to content

Commit

Permalink
Merge pull request #91 from agility/dlo/add-label-to-inputlabel
Browse files Browse the repository at this point in the history
Add default tooltip for label
  • Loading branch information
DerekAgility authored Jan 15, 2025
2 parents cc0e71b + 20c14ea commit bf9129e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stories/molecules/inputs/InputLabel/InputLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ const InputLabel: FC<IInputLabelProps> = ({
{ "inline-block transition-all text-sm text-gray-700 mb-1": !isPlaceholder },
{ "block w-full": fullWidthLabel }
);

if (!label) return null;
return (
<label htmlFor={id} className={labelStyles}>
<div className={truncateLabel ? "break-all line-clamp-1" : ""}>{label}</div>
<div className={truncateLabel ? "break-all line-clamp-1" : ""} title={label}>
{label}
</div>
{isRequired && <span className="text-red-500"> *</span>}
</label>
);
Expand Down

0 comments on commit bf9129e

Please sign in to comment.