Don't render field label components unless a label exists

This commit is contained in:
Andrew Kingston 2021-04-16 09:39:29 +01:00
parent e28bbf594b
commit aab06cdc36
1 changed files with 3 additions and 1 deletions

View File

@ -10,7 +10,9 @@
</script>
<div class="spectrum-Form-item" class:above={labelPosition === 'above'}>
{#if label}
<FieldLabel forId={id} {label} position={labelPosition} />
{/if}
<div class="spectrum-Form-itemField">
<slot />
{#if error}