Fixed autoscroll with small delay
This commit is contained in:
@@ -17,16 +17,15 @@ export const StandardEditor = ({
|
|||||||
if (editorRef.current && autoScroll) {
|
if (editorRef.current && autoScroll) {
|
||||||
const model = editorRef.current.getModel();
|
const model = editorRef.current.getModel();
|
||||||
const lineCount = model.getLineCount();
|
const lineCount = model.getLineCount();
|
||||||
editorRef.current.revealPositionInCenter({
|
editorRef.current.revealLine(lineCount, monaco.editor.ScrollType.Smooth);
|
||||||
lineNumber: lineCount,
|
|
||||||
column: 1
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditorDidMount = (editor) => {
|
const handleEditorDidMount = (editor) => {
|
||||||
editorRef.current = editor;
|
editorRef.current = editor;
|
||||||
scrollToBottom();
|
setTimeout(() => {
|
||||||
|
scrollToBottom();
|
||||||
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user