Просмотр исходного кода

BugFix: set cursor pos with header edit button

Yuki Takei 8 лет назад
Родитель
Сommit
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
   }