svelte select fix

This commit is contained in:
Jan Prochazka 2021-05-03 21:08:45 +02:00
parent 5622e3af77
commit 67e8eb32f7

View File

@ -2,10 +2,12 @@
import { getFormContext } from './FormProviderCore.svelte';
import SelectField from './SelectField.svelte';
import { createEventDispatcher } from 'svelte';
import _ from 'lodash';
const dispatch = createEventDispatcher();
export let name;
export let options;
export let isClearable = false;
const { values, setFieldValue } = getFormContext();
@ -14,6 +16,7 @@
<SelectField
{...$$restProps}
value={$values[name]}
options={_.compact(options)}
on:change={e => {
setFieldValue(name, e.detail);
dispatch('change', e.detail);