From 1a628dd720a21ee865ad94ad280d848ced851ec0 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 20 Mar 2023 15:27:30 +0100 Subject: [PATCH] fix minor app issues --- .../apps/components/inputs/AppSelect.svelte | 13 +++++++++---- .../inputs/currency/AppCurrencyInput.svelte | 2 +- .../lib/components/apps/editor/SubGridEditor.svelte | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte b/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte index a32ac69db3..f1f0ecaa8b 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppSelect.svelte @@ -22,7 +22,7 @@ let placeholder: string = 'Select an item' let outputs = initOutput($worldStore, id, { - result: undefined + result: undefined as string | undefined }) let value: string | undefined = outputs?.result.peak() @@ -40,10 +40,15 @@ } }) : [] + let rawValue if (defaultValue) { - value = JSON.stringify(defaultValue) + rawValue = defaultValue } else if (listItems.length > 0) { - value = listItems[0]?.value + rawValue = items[0].value + } + if (rawValue) { + value = JSON.stringify(rawValue) + outputs?.result.set(rawValue) } } @@ -62,7 +67,7 @@ try { result = JSON.parse(e.detail?.['value']) } catch (_) {} - value = result + value = e.detail?.['value'] outputs?.result.set(result) } diff --git a/frontend/src/lib/components/apps/components/inputs/currency/AppCurrencyInput.svelte b/frontend/src/lib/components/apps/components/inputs/currency/AppCurrencyInput.svelte index 4e969d3f14..87343d677b 100644 --- a/frontend/src/lib/components/apps/components/inputs/currency/AppCurrencyInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/currency/AppCurrencyInput.svelte @@ -58,7 +58,7 @@ {#key isNegativeAllowed} {#key locale} {#key currency} -
($selectedComponent = id)}> +
($selectedComponent = id)}> {:else}