diff --git a/packages/client/src/components/app/forms/MultiFieldSelect.svelte b/packages/client/src/components/app/forms/MultiFieldSelect.svelte index cecc569b6f..06811f3e05 100644 --- a/packages/client/src/components/app/forms/MultiFieldSelect.svelte +++ b/packages/client/src/components/app/forms/MultiFieldSelect.svelte @@ -20,6 +20,7 @@ let fieldSchema $: flatOptions = optionsSource == null || optionsSource === "schema" + $: expandedValue = expand(fieldState?.value) $: options = getOptions( optionsSource, fieldSchema, @@ -28,6 +29,18 @@ valueColumn, customOptions ) + + const expand = values => { + if (!values) { + return [] + } + + if (Array.isArray(values)) { + return values + } + + return values.split(",") + } {#if fieldState} x : x => x.label} getOptionValue={flatOptions ? x => x : x => x.value}