Set a condition for showing legend in FormGroup (#785)

We shouldn't add a <legend> If the the legend text specified.
This commit is contained in:
Bilux 2021-09-05 21:25:32 +01:00 committed by GitHub
commit 892c19a8dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,10 +30,12 @@
on:mouseenter on:mouseenter
on:mouseleave on:mouseleave
> >
{#if legendText}
<legend <legend
class:bx--label="{true}" class:bx--label="{true}"
id="{legendId || $$restProps['aria-labelledby']}">{legendText}</legend id="{legendId || $$restProps['aria-labelledby']}">{legendText}</legend
> >
{/if}
<slot /> <slot />
{#if message} {#if message}
<div class:bx--form__requirement="{true}">{messageText}</div> <div class:bx--form__requirement="{true}">{messageText}</div>