1
0
Fork 0
mirror of synced 2024-10-02 01:56:57 +13:00

Disable save button in drawerbindableinput when syntax is invalid

This commit is contained in:
Andrew Kingston 2021-07-14 15:45:05 +01:00
parent 38014a76be
commit 83d6a7c56d

View file

@ -17,6 +17,7 @@
const dispatch = createEventDispatcher()
let bindingDrawer
let valid = true
$: readableValue = runtimeToReadableBinding(bindings, value)
$: tempValue = readableValue
@ -48,10 +49,13 @@
<svelte:fragment slot="description">
Add the objects on the left to enrich your text.
</svelte:fragment>
<Button cta slot="buttons" on:click={saveBinding}>Save</Button>
<Button cta slot="buttons" disabled={!valid} on:click={saveBinding}>
Save
</Button>
<svelte:component
this={panel}
slot="body"
bind:valid
value={readableValue}
on:change={event => (tempValue = event.detail)}
bindableProperties={bindings}