Ensure empty values default to an empty string when null

This commit is contained in:
Dean 2025-01-30 11:56:26 +00:00
parent 352516a8b4
commit 942ba78f16
1 changed files with 3 additions and 2 deletions

View File

@ -360,7 +360,7 @@
{#if mode === BindingMode.Text} {#if mode === BindingMode.Text}
{#key hbsCompletions} {#key hbsCompletions}
<CodeEditor <CodeEditor
value={hbsValue} value={hbsValue || ""}
on:change={onChangeHBSValue} on:change={onChangeHBSValue}
bind:getCaretPosition bind:getCaretPosition
bind:insertAtPos bind:insertAtPos
@ -372,9 +372,10 @@
/> />
{/key} {/key}
{:else if mode === BindingMode.JavaScript} {:else if mode === BindingMode.JavaScript}
Binding panel {jsValue}
{#key jsCompletions} {#key jsCompletions}
<CodeEditor <CodeEditor
value={jsValue ? decodeJSBinding(jsValue) : jsValue} value={jsValue ? decodeJSBinding(jsValue) : ""}
on:change={onChangeJSValue} on:change={onChangeJSValue}
completions={jsCompletions} completions={jsCompletions}
mode={EditorModes.JS} mode={EditorModes.JS}