Fixed autoscroll with small delay

This commit is contained in:
2024-11-22 18:50:47 +01:00
parent eb89564aac
commit 5aa2383f26

View File

@@ -17,16 +17,15 @@ export const StandardEditor = ({
if (editorRef.current && autoScroll) {
const model = editorRef.current.getModel();
const lineCount = model.getLineCount();
editorRef.current.revealPositionInCenter({
lineNumber: lineCount,
column: 1
});
editorRef.current.revealLine(lineCount, monaco.editor.ScrollType.Smooth);
}
};
const handleEditorDidMount = (editor) => {
editorRef.current = editor;
scrollToBottom();
setTimeout(() => {
scrollToBottom();
}, 10);
};
React.useEffect(() => {