mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 14:56:01 +00:00
svelte select fix
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user