Skip to content

Commit 6a57517

Browse files
chakrihackerCompuIves
authored andcommitted
Preserve scroll position (codesandbox#543)
1 parent dde67b0 commit 6a57517

File tree

1 file changed

+1
-0
lines changed
  • packages/app/src/app/components/CodeEditor/Monaco

1 file changed

+1
-0
lines changed

packages/app/src/app/components/CodeEditor/Monaco/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ class MonacoEditor extends React.Component<Props, State> implements Editor {
889889
requestAnimationFrame(() => {
890890
if (modelInfo.cursorPos) {
891891
this.editor.setPosition(modelInfo.cursorPos);
892+
this.editor.revealPositionInCenter(modelInfo.cursorPos);
892893
}
893894

894895
this.syntaxHighlight(

0 commit comments

Comments
 (0)