Skip to content

Commit

Permalink
establish parent references before subform creation
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanbond committed Dec 22, 2024
1 parent baf0f25 commit de86e00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ export default class FormComponent extends Component {

// Make sure to not show the submit button in wizards in the nested forms.
_.set(options, 'buttonSettings.showSubmit', false);

// Set the parent options to the subform so those references are stable when the subform is created
options.parent = this;
options.parentVisible = this.visible;

if (!this.options) {
return options;
Expand Down Expand Up @@ -448,8 +452,6 @@ export default class FormComponent extends Component {
return (new Form(form, this.getSubOptions())).ready.then((instance) => {
this.subForm = instance;
this.subForm.currentForm = this;
this.subForm.parent = this;
this.subForm.parentVisible = this.visible;
this.subForm.on('change', () => {
if (this.subForm) {
this.dataValue = this.subForm.getValue();
Expand Down

0 comments on commit de86e00

Please sign in to comment.