fixed regression - broken select tag, because of Svelte upgrade

This commit is contained in:
Jan Prochazka 2021-09-29 20:55:34 +02:00
parent 97215e31e9
commit 99876e3158
3 changed files with 6 additions and 5 deletions

View File

@ -10,6 +10,7 @@
export let isNative = false;
export let isMulti = false;
export let notSelected = null;
export let defaultValue = '';
let listOpen = false;
let isFocused = false;
@ -21,18 +22,19 @@
{#if isNative}
<select
value={value || defaultValue}
{...$$restProps}
on:change={e => {
dispatch('change', e.target['value']);
}}
>
{#if notSelected}
<option value="" selected={!value}>
<option value="">
{_.isString(notSelected) ? notSelected : '(not selected)'}
</option>
{/if}
{#each _.compact(options) as x (x.value)}
<option value={x.value} selected={value == x.value}>
<option value={x.value}>
{x.label}
</option>
{/each}

View File

@ -24,7 +24,6 @@
$: disabledFields = (currentAuthType ? currentAuthType.disabledFields : null) || [];
$: driver = $extensions.drivers.find(x => x.engine == engine);
$: defaultDatabase = $values.defaultDatabase;
</script>
<FormSelectField
@ -125,6 +124,7 @@
label="Password mode"
isNative
name="passwordMode"
defaultValue="saveEncrypted"
options={[
{ value: 'saveEncrypted', label: 'Save and encrypt' },
{ value: 'saveRaw', label: 'Save raw (UNSAFE!!)' },
@ -154,5 +154,4 @@
.radio :global(label) {
margin-right: 10px;
}
</style>

View File

@ -43,4 +43,4 @@
}
</script>
<FormSelectFieldRaw {name} options={getOptions()} />
<FormSelectFieldRaw {name} options={getOptions()} isNative />