Skip to content

Commit fa9777e

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
fix: scroll to the bottom after the state update
Closes #1736 Signed-off-by: Akos Kitta <[email protected]>
1 parent 7721350 commit fa9777e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-output.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ export class SerialMonitorOutput extends React.Component<
6565
this.state.charCount
6666
);
6767
const [lines, charCount] = truncateLines(newLines, totalCharCount);
68-
this.setState({
69-
lines,
70-
charCount,
71-
});
72-
this.scrollToBottom();
68+
this.setState(
69+
{
70+
lines,
71+
charCount,
72+
},
73+
() => this.scrollToBottom()
74+
);
7375
}),
7476
this.props.clearConsoleEvent(() =>
7577
this.setState({ lines: [], charCount: 0 })

0 commit comments

Comments
 (0)