From c61a4df998c9fae069bda4db955fac4a4e51551a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Sep 2022 19:15:05 +0100 Subject: [PATCH] Updating params in the REST interface so that they can be used in and out of the URL - meaning that updating in one place affects the other. Reduces a bit of the confusing UX around this - discussed in #7683. --- .../bindings/DrawerBindableInput.svelte | 10 ++- .../integration/KeyValueBuilder.svelte | 9 ++- .../rest/[query]/index.svelte | 66 +++++++++++++------ 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index b8d418c62b..22d322985d 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -23,6 +23,7 @@ const dispatch = createEventDispatcher() let bindingDrawer let valid = true + let currentVal = value $: readableValue = runtimeToReadableBinding(bindings, value) $: tempValue = readableValue @@ -30,11 +31,17 @@ const saveBinding = () => { onChange(tempValue) + onBlur() bindingDrawer.hide() } const onChange = value => { - dispatch("change", readableToRuntimeBinding(bindings, value)) + currentVal = readableToRuntimeBinding(bindings, value) + dispatch("change", currentVal) + } + + const onBlur = () => { + dispatch("blur", currentVal) } @@ -45,6 +52,7 @@ readonly={isJS} value={isJS ? "(JavaScript function)" : readableValue} on:change={event => onChange(event.detail)} + on:blur={onBlur} {placeholder} {updateOnChange} /> diff --git a/packages/builder/src/components/integration/KeyValueBuilder.svelte b/packages/builder/src/components/integration/KeyValueBuilder.svelte index 4ffb380aa4..28db6b61c6 100644 --- a/packages/builder/src/components/integration/KeyValueBuilder.svelte +++ b/packages/builder/src/components/integration/KeyValueBuilder.svelte @@ -107,7 +107,7 @@ placeholder={keyPlaceholder} readonly={readOnly} bind:value={field.name} - on:change={changed} + on:blur={changed} /> {#if options} +