From 3e75703200eec8636522b54a0300065269fe68ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 25 Jul 2019 11:31:06 +0200 Subject: [PATCH] improve focus handling again --- packages/tiptap/src/Editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tiptap/src/Editor.js b/packages/tiptap/src/Editor.js index f761b25a1..4fda43622 100644 --- a/packages/tiptap/src/Editor.js +++ b/packages/tiptap/src/Editor.js @@ -344,14 +344,14 @@ export default class Editor extends Emitter { }) } - focus(position = 'start') { - if (position === null || position === false) { + focus(position = null) { + if ((this.view.focused && position === null) || position === false) { return } let pos = position - if (position === 'start' || position === true) { + if (position === 'start' || position === null) { pos = 0 } else if (position === 'end') { pos = this.state.doc.nodeSize - 2