mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
svelte select fix
This commit is contained in:
parent
5622e3af77
commit
67e8eb32f7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user