Skip to content

Commit

Permalink
fix(editor): Use the autofocus command from Text if available
Browse files Browse the repository at this point in the history
Together with nextcloud/text#4540, the cursor
position will be restored when opening the editor for a page.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Jul 17, 2023
1 parent 99bbe48 commit b1caa24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Page/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ export default {
},
focusEditor() {
this.wrapper()?.$editor?.commands.focus?.()
if (this.wrapper()?.$editor?.commands.autofocus) {
this.wrapper().$editor.commands.autofocus()
} else {
this.wrapper()?.$editor?.commands.focus?.()
}
},
addImage(name) {
Expand Down

0 comments on commit b1caa24

Please sign in to comment.