Add dialog close validation (#1704)

This commit is contained in:
Matt Irvine
2018-06-21 16:55:47 -07:00
committed by GitHub
parent 1871fd383e
commit 6c5fac997f
8 changed files with 84 additions and 5 deletions

View File

@@ -120,11 +120,13 @@ export class DialogModal extends Modal {
this.show();
}
public done(): void {
public async done(): Promise<void> {
if (this._dialog.okButton.enabled) {
this._onDone.fire();
this.dispose();
this.hide();
if (await this._dialog.validateClose()) {
this._onDone.fire();
this.dispose();
this.hide();
}
}
}