Check whether page is valid before enabling next button. (#2293)

This commit is contained in:
Cory Rivera
2018-08-22 12:12:33 -07:00
committed by GitHub
parent 000d064276
commit 8042b78f1e

View File

@@ -197,8 +197,9 @@ export class WizardModal extends Modal {
if (this._nextButton && this._doneButton) {
if (this._wizard.pages[index + 1]) {
let isPageValid = this._wizard.pages[index] && this._wizard.pages[index].valid;
this._nextButton.element.parentElement.classList.remove('dialogModal-hidden');
this._nextButton.enabled = this._wizard.pages[index + 1].enabled;
this._nextButton.enabled = isPageValid && this._wizard.pages[index + 1].enabled;
this._doneButton.element.parentElement.classList.add('dialogModal-hidden');
} else {
this._nextButton.element.parentElement.classList.add('dialogModal-hidden');