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:mouseleave
>
<legend
class:bx--label="{true}"
id="{legendId || $$restProps['aria-labelledby']}">{legendText}</legend
>
{#if legendText}
<legend
class:bx--label="{true}"
id="{legendId || $$restProps['aria-labelledby']}">{legendText}</legend
>
{/if}
<slot />
{#if message}
<div class:bx--form__requirement="{true}">{messageText}</div>