Dialog focus (#1472)

* focus on dialog controls when is open

* fix "Configure and Upload" label

* fix focus on user fields
This commit is contained in:
Alberto Iannaccone
2022-09-29 15:16:28 +02:00
committed by GitHub
parent d6cb23f782
commit 6f07717369
8 changed files with 22 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ export class UserFields extends Contribution {
}
}
private selectedFqbnAddress(): string | undefined {
private selectedFqbnAddress(): string | undefined {
const { boardsConfig } = this.boardsServiceProvider;
const fqbn = boardsConfig.selectedBoard?.fqbn;
if (!fqbn) {
@@ -78,7 +78,9 @@ export class UserFields extends Contribution {
): Promise<BoardUserField[] | undefined> {
const cached = this.cachedUserFields.get(key);
// Deep clone the array of board fields to avoid editing the cached ones
this.userFieldsDialog.value = cached ? cached.slice() : await this.boardsServiceProvider.selectedBoardUserFields();
this.userFieldsDialog.value = cached
? cached.slice()
: await this.boardsServiceProvider.selectedBoardUserFields();
const result = await this.userFieldsDialog.open();
if (!result) {
return;
@@ -140,10 +142,7 @@ export class UserFields extends Contribution {
}
notifyFailedWithError(e: Error): void {
if (
this.boardRequiresUserFields &&
CoreError.UploadFailed.is(e)
) {
if (this.boardRequiresUserFields && CoreError.UploadFailed.is(e)) {
this.userFieldsSet = false;
}
}