File tree 4 files changed +11
-6
lines changed
arduino-ide-extension/src/browser
4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export class UserFields extends Contribution {
58
58
}
59
59
}
60
60
61
- private selectedFqbnAddress ( ) : string | undefined {
61
+ private selectedFqbnAddress ( ) : string | undefined {
62
62
const { boardsConfig } = this . boardsServiceProvider ;
63
63
const fqbn = boardsConfig . selectedBoard ?. fqbn ;
64
64
if ( ! fqbn ) {
@@ -78,7 +78,9 @@ export class UserFields extends Contribution {
78
78
) : Promise < BoardUserField [ ] | undefined > {
79
79
const cached = this . cachedUserFields . get ( key ) ;
80
80
// Deep clone the array of board fields to avoid editing the cached ones
81
- this . userFieldsDialog . value = cached ? cached . slice ( ) : await this . boardsServiceProvider . selectedBoardUserFields ( ) ;
81
+ this . userFieldsDialog . value = cached
82
+ ? cached . slice ( )
83
+ : await this . boardsServiceProvider . selectedBoardUserFields ( ) ;
82
84
const result = await this . userFieldsDialog . open ( ) ;
83
85
if ( ! result ) {
84
86
return ;
@@ -140,10 +142,7 @@ export class UserFields extends Contribution {
140
142
}
141
143
142
144
notifyFailedWithError ( e : Error ) : void {
143
- if (
144
- this . boardRequiresUserFields &&
145
- CoreError . UploadFailed . is ( e )
146
- ) {
145
+ if ( this . boardRequiresUserFields && CoreError . UploadFailed . is ( e ) ) {
147
146
this . userFieldsSet = false ;
148
147
}
149
148
}
Original file line number Diff line number Diff line change @@ -171,6 +171,9 @@ export class UploadCertificateDialog extends AbstractDialog<void> {
171
171
Widget . detach ( this . widget ) ;
172
172
}
173
173
Widget . attach ( this . widget , this . contentNode ) ;
174
+ const firstButton = this . widget . node . querySelector ( 'button' ) ;
175
+ firstButton ?. focus ( ) ;
176
+
174
177
this . widget . busyCallback = this . busyCallback . bind ( this ) ;
175
178
super . onAfterAttach ( msg ) ;
176
179
this . update ( ) ;
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ export class UploadFirmwareDialog extends AbstractDialog<void> {
115
115
Widget . detach ( this . widget ) ;
116
116
}
117
117
Widget . attach ( this . widget , this . contentNode ) ;
118
+ const firstButton = this . widget . node . querySelector ( 'button' ) ;
119
+ firstButton ?. focus ( ) ;
118
120
this . widget . busyCallback = this . busyCallback . bind ( this ) ;
119
121
super . onAfterAttach ( msg ) ;
120
122
this . update ( ) ;
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ export const UserFieldsComponent = ({
71
71
field . label
72
72
) }
73
73
onChange = { updateUserField ( index ) }
74
+ autoFocus = { index === 0 }
74
75
/>
75
76
</ div >
76
77
</ div >
You can’t perform that action at this time.
0 commit comments