Browse Source

prevent null being appended to binding box

gh-pages
Martin McKeaveney 6 years ago
parent
commit
5a6306f49f
  1. 6
      packages/builder/src/components/design/PropertiesPanel/BindingPanel.svelte
  2. 824
      packages/builder/yarn.lock

6
packages/builder/src/components/design/PropertiesPanel/BindingPanel.svelte

@ -40,13 +40,14 @@
function addToText(readableBinding) { function addToText(readableBinding) {
const position = getCaretPosition() const position = getCaretPosition()
const toAdd = `{{ ${readableBinding} }}` const toAdd = `{{ ${readableBinding} }}`
if (position.start) { if (position.start) {
value = value =
value.substring(0, position.start) + value.substring(0, position.start) +
toAdd + toAdd +
value.substring(position.end, value.length) value.substring(position.end, value.length)
} else { } else {
value += toAdd value = toAdd
} }
} }
@ -110,7 +111,8 @@
bind:getCaretPosition bind:getCaretPosition
thin thin
bind:value bind:value
placeholder="Add text, or click the objects on the left to add them to the textbox." /> placeholder="Add text, or click the objects on the left to add them to
the textbox." />
{#if !valid} {#if !valid}
<p class="syntax-error"> <p class="syntax-error">
Current Handlebars syntax is invalid, please check the guide Current Handlebars syntax is invalid, please check the guide

824
packages/builder/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save