File tree 3 files changed +20
-4
lines changed
arduino-ide-extension/src/browser
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export class MonitorViewContribution extends AbstractViewContribution<MonitorWid
96
96
}
97
97
98
98
protected renderAutoScrollButton ( ) : React . ReactNode {
99
- return < React . Fragment >
99
+ return < React . Fragment key = 'autoscroll-toolbar-item' >
100
100
< div
101
101
title = 'Toggle Autoscroll'
102
102
className = { `item enabled fa fa-angle-double-down arduino-monitor ${ this . model . autoscroll ? 'toggled' : '' } ` }
@@ -111,7 +111,7 @@ export class MonitorViewContribution extends AbstractViewContribution<MonitorWid
111
111
}
112
112
113
113
protected renderTimestampButton ( ) : React . ReactNode {
114
- return < React . Fragment >
114
+ return < React . Fragment key = 'line-ending-toolbar-item' >
115
115
< div
116
116
title = 'Toggle Timestamp'
117
117
className = { `item enabled fa fa-clock-o arduino-monitor ${ this . model . timestamp ? 'toggled' : '' } ` }
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ export namespace SerialMonitorSendField {
25
25
}
26
26
27
27
export class SerialMonitorSendField extends React . Component < SerialMonitorSendField . Props , SerialMonitorSendField . State > {
28
+
29
+ protected inputField : HTMLInputElement | null ;
30
+
28
31
constructor ( props : SerialMonitorSendField . Props ) {
29
32
super ( props ) ;
30
33
this . state = { value : '' } ;
@@ -33,10 +36,22 @@ export class SerialMonitorSendField extends React.Component<SerialMonitorSendFie
33
36
this . handleSubmit = this . handleSubmit . bind ( this ) ;
34
37
}
35
38
39
+ componentDidMount ( ) {
40
+ if ( this . inputField ) {
41
+ this . inputField . focus ( ) ;
42
+ }
43
+ }
44
+
36
45
render ( ) {
37
46
return < React . Fragment >
38
47
< form onSubmit = { this . handleSubmit } >
39
- < input type = 'text' id = 'serial-monitor-send' autoComplete = 'off' value = { this . state . value } onChange = { this . handleChange } />
48
+ < input
49
+ tabIndex = { - 1 }
50
+ ref = { ref => this . inputField = ref }
51
+ type = 'text' id = 'serial-monitor-send'
52
+ autoComplete = 'off'
53
+ value = { this . state . value }
54
+ onChange = { this . handleChange } />
40
55
< input className = "btn" type = "submit" value = "Submit" />
41
56
</ form >
42
57
</ React . Fragment >
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export class ArduinoToolbarComponent extends React.Component<ArduinoToolbarCompo
47
47
render ( ) : React . ReactNode {
48
48
const tooltip = < div key = 'arduino-toolbar-tooltip' className = { 'arduino-toolbar-tooltip' } > { this . state . tooltip } </ div > ;
49
49
const items = [
50
- < React . Fragment >
50
+ < React . Fragment key = { this . props . side + '-arduino-toolbar-tooltip' } >
51
51
{ [ ...this . props . items ] . map ( item => TabBarToolbarItem . is ( item ) ? this . renderItem ( item ) : item . render ( ) ) }
52
52
</ React . Fragment >
53
53
]
@@ -103,6 +103,7 @@ export class ArduinoToolbar extends ReactWidget {
103
103
104
104
protected render ( ) : React . ReactNode {
105
105
return < ArduinoToolbarComponent
106
+ key = 'arduino-toolbar-component'
106
107
side = { this . side }
107
108
items = { [ ...this . items . values ( ) ] }
108
109
commands = { this . commands }
You can’t perform that action at this time.
0 commit comments