prevent null being appended to binding box

This commit is contained in:
Martin McKeaveney 2021-02-24 17:56:14 +00:00
parent a17a1fb07b
commit 73b6995a57
2 changed files with 18 additions and 812 deletions

View File

@ -40,13 +40,14 @@
function addToText(readableBinding) {
const position = getCaretPosition()
const toAdd = `{{ ${readableBinding} }}`
if (position.start) {
value =
value.substring(0, position.start) +
toAdd +
value.substring(position.end, value.length)
} else {
value += toAdd
value = toAdd
}
}
@ -110,7 +111,8 @@
bind:getCaretPosition
thin
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}
<p class="syntax-error">
Current Handlebars syntax is invalid, please check the guide

File diff suppressed because it is too large Load Diff