From c9b7d0a83991f6b41166931285d6315c119eccd9 Mon Sep 17 00:00:00 2001 From: Ryan McKay-Fleming Date: Tue, 24 Sep 2019 14:04:46 -0400 Subject: [PATCH] Allow for MenuBubbles appearing below the selection --- packages/tiptap/src/Plugins/MenuBubble.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tiptap/src/Plugins/MenuBubble.js b/packages/tiptap/src/Plugins/MenuBubble.js index 1e2f9e707..df2e6fe19 100644 --- a/packages/tiptap/src/Plugins/MenuBubble.js +++ b/packages/tiptap/src/Plugins/MenuBubble.js @@ -66,6 +66,7 @@ class Menu { this.isActive = false this.left = 0 this.bottom = 0 + this.top = 0 // the mousedown event is fired before blur so we can prevent it this.options.element.addEventListener('mousedown', this.handleClick) @@ -129,6 +130,7 @@ class Menu { this.left = Math.round(this.options.keepInBounds ? Math.min(box.width - (el.width / 2), Math.max(left, el.width / 2)) : left) this.bottom = Math.round(box.bottom - start.top) + this.top = Math.round(end.bottom - box.top) this.isActive = true this.sendUpdate() @@ -139,6 +141,7 @@ class Menu { isActive: this.isActive, left: this.left, bottom: this.bottom, + top: this.top, }) }