From e441041860da82ebc4bc5e7554a7f7735b54cedd Mon Sep 17 00:00:00 2001 From: Chrissi2812 Date: Thu, 7 Mar 2019 18:28:27 +0100 Subject: [PATCH] fix travis-ci: copied textRange function from prosemirror-view --- packages/tiptap/src/Plugins/MenuBubble.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()