diff --git a/src/Wizard.js b/src/Wizard.js index 7943e4b058..19103caf4d 100644 --- a/src/Wizard.js +++ b/src/Wizard.js @@ -19,7 +19,7 @@ export default class Wizard extends Webform { * - buttonSettings.show*(Previous, Next, Cancel): true (default) - determines if the button is shown. * - allowPrevious: false (default) - determines if the breadcrumb bar is clickable for visited tabs. */ - constructor(elementOrOptions, _options = undefined) { + constructor(elementOrOptions = undefined, _options = undefined) { let element, options; if (elementOrOptions instanceof HTMLElement || options) { element = elementOrOptions; @@ -112,11 +112,6 @@ export default class Wizard extends Webform { showCancel: !this.options.readOnly }); - if (!this.isSecondInit && this.options?.breadcrumbSettings) { - this.isClickableDefined = Object.prototype.hasOwnProperty.call(this.options?.breadcrumbSettings, 'clickable'); - this.isSecondInit = true; - } - this.options.breadcrumbSettings = _.defaults(this.options.breadcrumbSettings, { clickable: true }); @@ -347,7 +342,15 @@ export default class Wizard extends Webform { } }); - return this.isClickableDefined ? this.options.breadcrumbSettings.clickable : _.get(currentPage, 'component.breadcrumbClickable', true); + if (_.has(currentPage, 'component.breadcrumbClickable')) { + return _.get(currentPage, 'component.breadcrumbClickable'); + } + + if (_.has(this.options, 'breadcrumbSettings.clickable')) { + return this.options.breadcrumbSettings.clickable; + } + + return true; } isAllowPrevious() {