Skip to content

Commit

Permalink
Merge pull request #5947 from formio/FIO-9339-fixed-preview-when-edit…
Browse files Browse the repository at this point in the history
…ing-json

FIO-9339: fixed an issue where preview shows an error when editing component JSON
  • Loading branch information
brendanbond authored Dec 12, 2024
2 parents 8001bf7 + acce78f commit 74aadbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/WebformBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,8 @@ export default class WebformBuilder extends Component {
helplinks: this.helplinks,
}));
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
this.updateComponent(this.editForm.submission.data ?? component);
const editFormData = this.editForm.submission?.data;
this.updateComponent(editFormData?.componentJson || editFormData || component);
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
});
});
Expand Down

0 comments on commit 74aadbb

Please sign in to comment.