From 3ed9f61fd7921e4348bfd1711c6102c406d44dca Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 17 Jul 2023 14:15:54 +0200 Subject: [PATCH] fix(editor): Use the `autofocus` command from Text if available Together with https://github.com/nextcloud/text/pull/4540, the cursor position will be restored when opening the editor for a page. Signed-off-by: Jonas --- src/components/Page/TextEditor.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Page/TextEditor.vue b/src/components/Page/TextEditor.vue index bb2ca6c8e..44bc99fcc 100644 --- a/src/components/Page/TextEditor.vue +++ b/src/components/Page/TextEditor.vue @@ -145,7 +145,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) {