mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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> {
|
public async done(): Promise<void> {
|
||||||
if (this._dialog.okButton.enabled) {
|
if (this._doneButton.enabled) {
|
||||||
if (await this._dialog.validateClose()) {
|
if (await this._dialog.validateClose()) {
|
||||||
this._onDone.fire();
|
this._onDone.fire();
|
||||||
this.dispose();
|
this.dispose();
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ export class WizardModal extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async done(validate: boolean = true): Promise<void> {
|
public async done(validate: boolean = true): Promise<void> {
|
||||||
if (this._wizard.doneButton.enabled) {
|
if (this._doneButton.enabled) {
|
||||||
if (validate && !await this._wizard.validateNavigation(undefined)) {
|
if (validate && !await this._wizard.validateNavigation(undefined)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -242,7 +242,13 @@ export class WizardModal extends Modal {
|
|||||||
* Overridable to change behavior of enter key
|
* Overridable to change behavior of enter key
|
||||||
*/
|
*/
|
||||||
protected onAccept(e: StandardKeyboardEvent) {
|
protected onAccept(e: StandardKeyboardEvent) {
|
||||||
|
if (this._wizard.currentPage === this._wizard.pages.length - 1) {
|
||||||
this.done();
|
this.done();
|
||||||
|
} else {
|
||||||
|
if (this._nextButton.enabled) {
|
||||||
|
this.showPage(this._wizard.currentPage + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user