Skip to content

Commit

Permalink
fix: preview control change
Browse files Browse the repository at this point in the history
changing a previe win the editor would change the controls config through reference
  • Loading branch information
kevinchappell committed Nov 15, 2024
1 parent 7f3c0b8 commit e1ee84f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/js/components/controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class Controls {
}

get(controlId) {
return this.data.get(controlId)
return clone(this.data.get(controlId))
}

/**
Expand Down Expand Up @@ -355,6 +355,7 @@ export class Controls {
*/
addElement = id => {
const controlData = get(this.get(id), 'controlData')

const {
meta: { group, id: metaId },
} = controlData
Expand Down
1 change: 1 addition & 0 deletions src/lib/js/components/fields/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export default class Field extends Component {
}
},
input: evt => {
console.log(evt)
if (['input', 'meter', 'progress', 'button'].includes(evt.target.tagName.toLowerCase())) {
super.set('attrs.value', evt.target.value)
return this.debouncedUpdateEditPanels()
Expand Down

0 comments on commit e1ee84f

Please sign in to comment.