Skip to content

Commit

Permalink
chore: do not render form header when label or description is not pre…
Browse files Browse the repository at this point in the history
…sent (#4035)
  • Loading branch information
datlechin authored Sep 28, 2024
1 parent 6444ccd commit 40a84fc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions framework/core/js/src/common/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export default class Form<CustomAttrs extends IFormAttrs = IFormAttrs> extends C

return (
<div className={classList('Form', className)} {...attrs}>
<div className="Form-header">
{label && <label>{label}</label>}
{description && <p className="helpText">{description}</p>}
</div>
{(label || description) && (
<div className="Form-header">
{label && <label>{label}</label>}
{description && <p className="helpText">{description}</p>}
</div>
)}
<div className="Form-body">{vnode.children}</div>
</div>
);
Expand Down

0 comments on commit 40a84fc

Please sign in to comment.