From ce01d975b31aa44ed705461d14b4b48330f00c18 Mon Sep 17 00:00:00 2001 From: Clement Zhang Date: Mon, 18 Nov 2024 12:09:42 +0100 Subject: [PATCH] multiselect: handle duplicates (do not allow) --- .../apps/components/inputs/AppMultiSelectV2.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/apps/components/inputs/AppMultiSelectV2.svelte b/frontend/src/lib/components/apps/components/inputs/AppMultiSelectV2.svelte index d01a594c75..f13c2d8602 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppMultiSelectV2.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppMultiSelectV2.svelte @@ -59,9 +59,6 @@ } $: if (resolvedConfig.defaultItems) { - console.log(resolvedConfig.defaultItems) - console.log(findOptionsByValue(resolvedConfig.defaultItems)) - selectOptionsByValue(resolvedConfig.defaultItems) } @@ -173,6 +170,10 @@ {options} placeholder={resolvedConfig.placeholder} allowUserOptions={resolvedConfig.create} + key={(option) => { + if (typeof option == 'string' || typeof option == 'number') return option + return option.value + }} on:change={(event) => { if (event?.detail?.type === 'removeAll') { outputs?.result.set([])