Browse Source

BugFix: call setScrollTopByLine after setCursor

Yuki Takei 8 years ago
parent
commit
a1c01e03af
1 changed files with 1 additions and 1 deletions
  1. 1 1
      resource/js/components/PageEditor/Editor.js

+ 1 - 1
resource/js/components/PageEditor/Editor.js

@@ -104,8 +104,8 @@ export default class Editor extends React.Component {
     const editor = this.getCodeMirror();
     const linePosition = Math.max(0, line);
 
-    this.setScrollTopByLine(linePosition);
     editor.setCursor({line: linePosition});   // leave 'ch' field as null/undefined to indicate the end of line
+    this.setScrollTopByLine(linePosition);
   }
 
   /**