also set defaultValue
This commit is contained in:
parent
d2ffc2e920
commit
7ed18caa31
|
@ -20,6 +20,7 @@
|
||||||
let fieldSchema
|
let fieldSchema
|
||||||
|
|
||||||
$: flatOptions = optionsSource == null || optionsSource === "schema"
|
$: flatOptions = optionsSource == null || optionsSource === "schema"
|
||||||
|
$: expandedDefaultValue = expand(fieldState?.defaultValue)
|
||||||
$: expandedValue = expand(fieldState?.value)
|
$: expandedValue = expand(fieldState?.value)
|
||||||
$: options = getOptions(
|
$: options = getOptions(
|
||||||
optionsSource,
|
optionsSource,
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
|
|
||||||
return values.split(",")
|
return values.split(",").map(value => value.trim())
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -57,6 +58,7 @@
|
||||||
{#if fieldState}
|
{#if fieldState}
|
||||||
<CoreMultiselect
|
<CoreMultiselect
|
||||||
value={expandedValue}
|
value={expandedValue}
|
||||||
|
defaultValue={expandedDefaultValue}
|
||||||
error={fieldState.error}
|
error={fieldState.error}
|
||||||
getOptionLabel={flatOptions ? x => x : x => x.label}
|
getOptionLabel={flatOptions ? x => x : x => x.label}
|
||||||
getOptionValue={flatOptions ? x => x : x => x.value}
|
getOptionValue={flatOptions ? x => x : x => x.value}
|
||||||
|
|
Loading…
Reference in New Issue