From 6445cefee71db6e68fbb4634a5307cf0e0a17959 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Feb 2022 13:49:20 +0000 Subject: [PATCH] Fixing issue with value being set in binding panel as per review comments of aptkingston. --- .../src/components/common/bindings/BindingPanel.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index 08578fff33..5c12d43ceb 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -23,6 +23,10 @@ const dispatch = createEventDispatcher() export let bindings + // jsValue/hbsValue are the state of the value that is being built + // within this binding panel - the value should not be updated until + // the binding panel is saved. This is the default value of the + // expression when the binding panel is opened, but shouldn't be updated. export let value = "" export let valid export let allowJS = false @@ -53,7 +57,6 @@ const updateValue = val => { valid = isValid(readableToRuntimeBinding(bindings, val)) - value = val if (valid) { dispatch("change", value) } @@ -61,7 +64,7 @@ // Adds a HBS helper to the expression const addHelper = helper => { - hbsValue = addHBSBinding(value, getCaretPosition(), helper.text) + hbsValue = addHBSBinding(hbsValue, getCaretPosition(), helper.text) updateValue(hbsValue) }