Browse Source

Fixing issue with value being set in binding panel as per review comments of aptkingston.

master
mike12345567 5 years ago
parent
commit
8411a0e6c3
  1. 7
      packages/builder/src/components/common/bindings/BindingPanel.svelte

7
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)
}

Loading…
Cancel
Save