Преглед изворни кода

BugFix: set cursor pos with header edit button

Yuki Takei пре 8 година
родитељ
комит
f3340ddbae
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      resource/js/components/PageEditor/Editor.js

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

@@ -102,7 +102,7 @@ export default class Editor extends React.Component {
     const lastLine = editor.getDoc().lastLine();
     editor.scrollIntoView(lastLine);
 
-    const linePosition = Math.max(0, line - 1);
+    const linePosition = Math.max(0, line);
     editor.scrollIntoView(linePosition);
     editor.setCursor({line: linePosition});   // leave 'ch' field as null/undefined to indicate the end of line
   }