mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 09:35:38 -05:00
Automatically focus the execute button in the DacFx wizard summary screens (#6984)
* Focus piping for extension buttons * Focus the done button when entering the summary page for DacFx wizard * Adding internal value resets for extension-side button model. * Correcting remark string
This commit is contained in:
@@ -119,6 +119,11 @@ export class WizardModal extends Modal {
|
||||
buttonElement.label = dialogButton.label;
|
||||
buttonElement.enabled = requirePageValid ? dialogButton.enabled && this._wizard.pages[this._wizard.currentPage].valid : dialogButton.enabled;
|
||||
dialogButton.hidden ? buttonElement.element.parentElement.classList.add('dialogModal-hidden') : buttonElement.element.parentElement.classList.remove('dialogModal-hidden');
|
||||
|
||||
if (dialogButton.focused) {
|
||||
buttonElement.focus();
|
||||
}
|
||||
|
||||
this.setButtonsForPage(this._wizard.currentPage);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ export class DialogButton implements azdata.window.Button {
|
||||
private _label: string;
|
||||
private _enabled: boolean;
|
||||
private _hidden: boolean;
|
||||
private _focused: boolean;
|
||||
private _onClick: Emitter<void> = new Emitter<void>();
|
||||
public readonly onClick: Event<void> = this._onClick.event;
|
||||
private _onUpdate: Emitter<void> = new Emitter<void>();
|
||||
@@ -121,6 +122,15 @@ export class DialogButton implements azdata.window.Button {
|
||||
this._onUpdate.fire();
|
||||
}
|
||||
|
||||
public get focused(): boolean {
|
||||
return this._focused;
|
||||
}
|
||||
|
||||
public set focused(focused: boolean) {
|
||||
this._focused = focused;
|
||||
this._onUpdate.fire();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an event that notifies the button that it has been clicked
|
||||
*/
|
||||
@@ -255,4 +265,4 @@ export class Wizard {
|
||||
this._message = value;
|
||||
this._onMessageChange.fire(this._message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user