Always provide context from form fields regardless of standalone mode to ensure global bindings work when nesting inside a form

This commit is contained in:
Andrew Kingston 2024-11-08 12:15:12 +00:00
parent f08e528c99
commit 25bfc65764
No known key found for this signature in database
1 changed files with 47 additions and 47 deletions

View File

@ -99,8 +99,8 @@
})
</script>
{#if !formContext}
<Provider data={{ value: fieldState?.value }}>
<Provider data={{ value: fieldState?.value }}>
{#if !formContext}
<InnerForm
{disabled}
{readonly}
@ -111,8 +111,7 @@
<slot />
</svelte:self>
</InnerForm>
</Provider>
{:else}
{:else}
<div
class="spectrum-Form-item"
class:span-2={span === 2}
@ -157,7 +156,8 @@
{/if}
</div>
</div>
{/if}
{/if}
</Provider>
<style>
:global(.form-block .spectrum-Form-item.span-2) {