mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 17:22:59 -05:00
Fix enter button behavior for wizards and dialogs (#1868)
This commit is contained in:
@@ -124,7 +124,7 @@ export class DialogModal extends Modal {
|
||||
}
|
||||
|
||||
public async done(): Promise<void> {
|
||||
if (this._dialog.okButton.enabled) {
|
||||
if (this._doneButton.enabled) {
|
||||
if (await this._dialog.validateClose()) {
|
||||
this._onDone.fire();
|
||||
this.dispose();
|
||||
|
||||
@@ -207,7 +207,7 @@ export class WizardModal extends Modal {
|
||||
}
|
||||
|
||||
public async done(validate: boolean = true): Promise<void> {
|
||||
if (this._wizard.doneButton.enabled) {
|
||||
if (this._doneButton.enabled) {
|
||||
if (validate && !await this._wizard.validateNavigation(undefined)) {
|
||||
return;
|
||||
}
|
||||
@@ -242,7 +242,13 @@ export class WizardModal extends Modal {
|
||||
* Overridable to change behavior of enter key
|
||||
*/
|
||||
protected onAccept(e: StandardKeyboardEvent) {
|
||||
this.done();
|
||||
if (this._wizard.currentPage === this._wizard.pages.length - 1) {
|
||||
this.done();
|
||||
} else {
|
||||
if (this._nextButton.enabled) {
|
||||
this.showPage(this._wizard.currentPage + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user