diff --git a/packages/web/package.json b/packages/web/package.json index a1ba7b05..a7b6d7ce 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -49,7 +49,7 @@ "svelte-check": "^1.0.0", "svelte-markdown": "^0.1.4", "svelte-preprocess": "^4.9.5", - "svelte-select": "^3.17.0", + "svelte-select": "^4.4.7", "tslib": "^2.3.1", "typescript": "^4.4.3", "uuid": "^3.4.0" diff --git a/packages/web/src/forms/SelectField.svelte b/packages/web/src/forms/SelectField.svelte index ab751835..eadd937d 100644 --- a/packages/web/src/forms/SelectField.svelte +++ b/packages/web/src/forms/SelectField.svelte @@ -44,9 +44,9 @@ options.find(x => x.value == item)) - : options.find(x => x.value == value)} + value={isMulti + ? _.compact(value?.map(item => options.find(x => x.value == item)) ?? []) + : options.find(x => x.value == value) ?? null} on:select={e => { if (isMulti) { dispatch( diff --git a/yarn.lock b/yarn.lock index 678571a6..1bfbdedc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10146,10 +10146,10 @@ svelte-preprocess@^4.9.5: sorcery "^0.10.0" strip-indent "^3.0.0" -svelte-select@^3.17.0: - version "3.17.0" - resolved "https://registry.yarnpkg.com/svelte-select/-/svelte-select-3.17.0.tgz#6bea0cb8d0c9465d28a2bac562f2de8a61f48a9f" - integrity sha512-ITmX/XUiSdkaILmsTviKRkZPaXckM5/FA7Y8BhiUPoamaZG/ZDyOo6ydjFu9fDVFTbwoAUGUi6HBjs+ZdK2AwA== +svelte-select@^4.4.7: + version "4.4.7" + resolved "https://registry.yarnpkg.com/svelte-select/-/svelte-select-4.4.7.tgz#fc85414af070487d68e438f7249c653178860af3" + integrity sha512-fIf9Z8rPI6F8naHZ9wjXT0Pv5gLyhdHAFkHFJnCfVVfELE8e82uOoF0xEVQP6Kir+b4Q5yOvNAzZ61WbSU6A0A== svelte@^3.43.0: version "3.43.0"