Browse Source

Merge pull request #2686 from mslourens/replace_all_handlebars_bindings

replace all handlebars bindings, not just the first
pull/2709/head
Michael Drury 5 years ago
committed by GitHub
parent
commit
26ea796935
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/builder/src/builderStore/dataBinding.js

5
packages/builder/src/builderStore/dataBinding.js

@ -443,7 +443,10 @@ function bindingReplacement(bindableProperties, textWithBindings, convertTo) {
for (let from of convertFromProps) {
if (shouldReplaceBinding(newBoundValue, from, convertTo)) {
const binding = bindableProperties.find(el => el[convertFrom] === from)
newBoundValue = newBoundValue.replace(from, binding[convertTo])
newBoundValue = newBoundValue.replace(
new RegExp(from, "gi"),
binding[convertTo]
)
}
}
result = result.replace(boundValue, newBoundValue)

Loading…
Cancel
Save