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