Revert changes to MultiFieldSelect

This commit is contained in:
Andrew Kingston 2022-01-18 15:25:43 +00:00
parent 89bb1fcdaa
commit 117cdcbd02
1 changed files with 1 additions and 12 deletions

View File

@ -19,7 +19,6 @@
let fieldApi let fieldApi
let fieldSchema let fieldSchema
$: safeDefaultValue = getSafeDefaultValue(defaultValue)
$: flatOptions = optionsSource == null || optionsSource === "schema" $: flatOptions = optionsSource == null || optionsSource === "schema"
$: options = getOptions( $: options = getOptions(
optionsSource, optionsSource,
@ -29,16 +28,6 @@
valueColumn, valueColumn,
customOptions customOptions
) )
const getSafeDefaultValue = value => {
if (value == null || value === "") {
return []
}
if (!Array.isArray(value)) {
return [value]
}
return value
}
</script> </script>
<Field <Field
@ -46,7 +35,7 @@
{label} {label}
{disabled} {disabled}
{validation} {validation}
defaultValue={safeDefaultValue} {defaultValue}
type="array" type="array"
bind:fieldState bind:fieldState
bind:fieldApi bind:fieldApi