Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 24dc0bb

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
fix: update monitor output after widget show
Closes #1724 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent fa9777e commit 24dc0bb

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

‎arduino-ide-extension/src/browser/serial/monitor/monitor-widget.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export class MonitorWidget extends ReactWidget {
117117
(this.focusNode || this.node).focus();
118118
}
119119

120+
protected override onAfterShow(msg: Message): void {
121+
super.onAfterShow(msg);
122+
this.update();
123+
}
124+
120125
protected onFocusResolved = (element: HTMLElement | undefined) => {
121126
if (this.closing || !this.isAttached) {
122127
return;

‎arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class SerialMonitorOutput extends React.Component<
1717
* Do not touch it. It is used to be able to "follow" the serial monitor log.
1818
*/
1919
protected toDisposeBeforeUnmount = new DisposableCollection();
20-
private listRef: React.RefObject<any>;
20+
private listRef: React.RefObject<List>;
2121

2222
constructor(props: Readonly<SerialMonitorOutput.Props>) {
2323
super(props);
@@ -34,12 +34,10 @@ export class SerialMonitorOutput extends React.Component<
3434
<List
3535
className="serial-monitor-messages"
3636
height={this.props.height}
37-
itemData={
38-
{
39-
lines: this.state.lines,
40-
timestamp: this.state.timestamp,
41-
} as any
42-
}
37+
itemData={{
38+
lines: this.state.lines,
39+
timestamp: this.state.timestamp,
40+
}}
4341
itemCount={this.state.lines.length}
4442
itemSize={18}
4543
width={'100%'}
@@ -93,11 +91,11 @@ export class SerialMonitorOutput extends React.Component<
9391
this.toDisposeBeforeUnmount.dispose();
9492
}
9593

96-
scrollToBottom = ((): void => {
94+
privatereadonlyscrollToBottom = () => {
9795
if (this.listRef.current && this.props.monitorModel.autoscroll) {
9896
this.listRef.current.scrollToItem(this.state.lines.length, 'end');
9997
}
100-
}).bind(this);
98+
};
10199
}
102100

103101
const _Row = ({

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /