From 5b58bd9be62588050b56072745e95b0f3ff380a0 Mon Sep 17 00:00:00 2001 From: Bastiaan Terhorst Date: Wed, 19 Jan 2022 09:19:49 +0100 Subject: [PATCH] set defaultValue in Field component --- .../src/components/app/forms/MultiFieldSelect.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/app/forms/MultiFieldSelect.svelte b/packages/client/src/components/app/forms/MultiFieldSelect.svelte index 5705b28e14..686198dfe1 100644 --- a/packages/client/src/components/app/forms/MultiFieldSelect.svelte +++ b/packages/client/src/components/app/forms/MultiFieldSelect.svelte @@ -20,8 +20,7 @@ let fieldSchema $: flatOptions = optionsSource == null || optionsSource === "schema" - $: expandedDefaultValue = expand(fieldState?.defaultValue) - $: expandedValue = expand(fieldState?.value) + $: expandedDefaultValue = expand(defaultValue) $: options = getOptions( optionsSource, fieldSchema, @@ -49,7 +48,7 @@ {label} {disabled} {validation} - {defaultValue} + defaultValue={expandedDefaultValue} type="array" bind:fieldState bind:fieldApi @@ -57,8 +56,7 @@ > {#if fieldState} x : x => x.label} getOptionValue={flatOptions ? x => x : x => x.value}