Преглед на файлове

BugFix: call setScrollTopByLine after setCursor

Yuki Takei преди 8 години
родител
ревизия
a1c01e03af
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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);
   }
 
   /**