Fixing an import and fixing a util function which was throwing an error in cypress tests.
This commit is contained in:
parent
48a0c66972
commit
ded7a739fa
|
@ -4,7 +4,7 @@
|
|||
readableToRuntimeBinding,
|
||||
runtimeToReadableBinding,
|
||||
} from "builderStore/dataBinding"
|
||||
import BindingPanel from "components/design/PropertiesPanel/BindingPanel.svelte"
|
||||
import BindingPanel from "components/common/bindings/BindingPanel.svelte"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
export function addToText(value, caretPos, binding) {
|
||||
binding = typeof binding === "string" ? binding : binding.path
|
||||
let toAdd = binding
|
||||
value = value == null ? "" : value
|
||||
if (!value.includes("{{") && !value.includes("}}")) {
|
||||
toAdd = `{{ ${binding} }}`
|
||||
binding = `{{ ${binding} }}`
|
||||
}
|
||||
if (caretPos.start) {
|
||||
value =
|
||||
value.substring(0, caretPos.start) +
|
||||
toAdd +
|
||||
binding +
|
||||
value.substring(caretPos.end, value.length)
|
||||
} else {
|
||||
value += toAdd
|
||||
value += binding
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue