1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

also set defaultValue

This commit is contained in:
Bastiaan Terhorst 2022-01-18 16:48:08 +01:00
parent dd44c4e7e3
commit 54a1c84179

View file

@ -20,6 +20,7 @@
let fieldSchema
$: flatOptions = optionsSource == null || optionsSource === "schema"
$: expandedDefaultValue = expand(fieldState?.defaultValue)
$: expandedValue = expand(fieldState?.value)
$: options = getOptions(
optionsSource,
@ -39,7 +40,7 @@
return values
}
return values.split(",")
return values.split(",").map(value => value.trim())
}
</script>
@ -57,6 +58,7 @@
{#if fieldState}
<CoreMultiselect
value={expandedValue}
defaultValue={expandedDefaultValue}
error={fieldState.error}
getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value}