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 deb0b2998f
commit e894bb5ddc
1 changed files with 5 additions and 1 deletions

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}