Explorar o código

BugFix: set cursor pos with header edit button

Yuki Takei %!s(int64=8) %!d(string=hai) anos
pai
achega
f3340ddbae
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
   }