Skip to content

Commit

Permalink
WIP: reset current page when nested wizards exist and page is conditi…
Browse files Browse the repository at this point in the history
…onally hidden
  • Loading branch information
blakekrammes committed Nov 18, 2024
1 parent 5777d3d commit cb0bb4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class Wizard extends Webform {

if (this.component.key) {
ctx.panels.map(panel => {
if (panel.key === this.component.key) {
if (panel.key === this.component.key && panel.title === this.component.title) {
this.currentPanel = panel;
ctx.wizardPageTooltip = this.getFormattedTooltip(panel.tooltip);
}
Expand Down Expand Up @@ -1013,6 +1013,9 @@ export default class Wizard extends Webform {
currentPanels = this.pages.map(page => page.component.key);
this.establishPages();
panels = this.pages.map(page => page.component.key);
if (panels.length !== currentPanels.length) {
this.setPage(this.pages.findIndex(page => page.component.title === this.currentPanel.components[0].label));
}
}
else {
currentPanels = this.currentPanels || this.pages.map(page => page.component.key);
Expand Down Expand Up @@ -1080,7 +1083,7 @@ export default class Wizard extends Webform {
errors = [...errors, ...subWizard.errors]
}
})
};
}
return super.showErrors(errors, triggerEvent)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/selectboxes/SelectBoxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export default class SelectBoxesComponent extends RadioComponent {
return super.setCustomValidity(_.filter(messages, (message) => message.ruleName !=='invalidValueProperty'), dirty, external);
} else {
return super.setCustomValidity(messages, dirty, external);
};
}
}

validateValueAvailability(setting, value) {
Expand Down

0 comments on commit cb0bb4a

Please sign in to comment.