fix keyboard focus issues (#16206)

This commit is contained in:
Alan Ren
2021-07-16 13:27:15 -07:00
committed by GitHub
parent 3847271e67
commit eed792f3db
19 changed files with 69 additions and 86 deletions

View File

@@ -133,8 +133,8 @@ export class WizardModal extends Modal {
this._mpContainer = append(this._body, $('div.dialog-message-and-page-container'));
this._pageContainer = append(this._mpContainer, $('div.dialogModal-page-container'));
this._wizard.pages.forEach(page => {
this.registerPage(page);
this._wizard.pages.forEach((page, index) => {
this.registerPage(page, index === 0); // only do auto-focus for the first page.
});
this._wizard.onPageAdded(page => {
this.registerPage(page);
@@ -167,8 +167,8 @@ export class WizardModal extends Modal {
});
}
private registerPage(page: WizardPage): void {
let dialogPane = new DialogPane(page.title, page.content, valid => page.notifyValidityChanged(valid), this._instantiationService, this._themeService, this._wizard.displayPageTitles, page.description);
private registerPage(page: WizardPage, setInitialFocus: boolean = false): void {
let dialogPane = new DialogPane(page.title, page.content, valid => page.notifyValidityChanged(valid), this._instantiationService, this._themeService, this._wizard.displayPageTitles, page.description, setInitialFocus);
dialogPane.createBody(this._pageContainer);
this._dialogPanes.set(page, dialogPane);
page.onUpdate(() => this.setButtonsForPage(this._wizard.currentPage));