Skip to content

Commit e1ee84f

Browse files
committed
fix: preview control change
changing a previe win the editor would change the controls config through reference
1 parent 7f3c0b8 commit e1ee84f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/lib/js/components/controls/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export class Controls {
158158
}
159159

160160
get(controlId) {
161-
return this.data.get(controlId)
161+
return clone(this.data.get(controlId))
162162
}
163163

164164
/**
@@ -355,6 +355,7 @@ export class Controls {
355355
*/
356356
addElement = id => {
357357
const controlData = get(this.get(id), 'controlData')
358+
358359
const {
359360
meta: { group, id: metaId },
360361
} = controlData

src/lib/js/components/fields/field.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ export default class Field extends Component {
280280
}
281281
},
282282
input: evt => {
283+
console.log(evt)
283284
if (['input', 'meter', 'progress', 'button'].includes(evt.target.tagName.toLowerCase())) {
284285
super.set('attrs.value', evt.target.value)
285286
return this.debouncedUpdateEditPanels()

0 commit comments

Comments
 (0)