diff --git a/packages/tiptap/src/Plugins/MenuBubble.js b/packages/tiptap/src/Plugins/MenuBubble.js index e003d37de9e..0a0235d37d5 100644 --- a/packages/tiptap/src/Plugins/MenuBubble.js +++ b/packages/tiptap/src/Plugins/MenuBubble.js @@ -1,5 +1,11 @@ import { Plugin } from 'prosemirror-state' -import { textRange } from 'prosemirror-view/src/dom' + +function textRange(node, from, to) { + const range = document.createRange() + range.setEnd(node, to == null ? node.nodeValue.length : to) + range.setStart(node, from || 0) + return range +} function singleRect(object, bias) { const rects = object.getClientRects()