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