diff --git a/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx b/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx index 136180202..12142f654 100644 --- a/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx +++ b/arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx @@ -65,11 +65,13 @@ export class SerialMonitorOutput extends React.Component< this.state.charCount ); const [lines, charCount] = truncateLines(newLines, totalCharCount); - this.setState({ - lines, - charCount, - }); - this.scrollToBottom(); + this.setState( + { + lines, + charCount, + }, + () => this.scrollToBottom() + ); }), this.props.clearConsoleEvent(() => this.setState({ lines: [], charCount: 0 })