mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
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:
parent
abfc472c82
commit
892c19a8dd
1 changed files with 6 additions and 4 deletions
|
@ -30,10 +30,12 @@
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
on:mouseleave
|
on:mouseleave
|
||||||
>
|
>
|
||||||
<legend
|
{#if legendText}
|
||||||
class:bx--label="{true}"
|
<legend
|
||||||
id="{legendId || $$restProps['aria-labelledby']}">{legendText}</legend
|
class:bx--label="{true}"
|
||||||
>
|
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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue