Browse Source

Fix ID's not being made unique when copying components

master
Andrew Kingston 6 years ago
parent
commit
8962440901
  1. 9
      packages/builder/src/builderStore/store/frontend.js

9
packages/builder/src/builderStore/store/frontend.js

@ -416,7 +416,14 @@ export const getFrontendStore = () => {
if (cut) { if (cut) {
state.componentToPaste = null state.componentToPaste = null
} else { } else {
componentToPaste._id = uuid() const randomizeIds = component => {
if (!component) {
return
}
component._id = uuid()
component.children?.forEach(randomizeIds)
}
randomizeIds(componentToPaste)
} }
if (mode === "inside") { if (mode === "inside") {

Loading…
Cancel
Save