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}