diff --git a/packages/tiptap/src/Plugins/MenuBubble.js b/packages/tiptap/src/Plugins/MenuBubble.js index 24351d49..1964df4e 100644 --- a/packages/tiptap/src/Plugins/MenuBubble.js +++ b/packages/tiptap/src/Plugins/MenuBubble.js @@ -3,7 +3,7 @@ import { Plugin, PluginKey } from 'prosemirror-state' function textRange(node, from, to) { const range = document.createRange() range.setEnd(node, to == null ? node.nodeValue.length : to) - range.setStart(node, from || 0) + range.setStart(node, Math.max(from, 0)) return range }