diff --git a/packages/tiptap/src/Plugins/FloatingMenu.js b/packages/tiptap/src/Plugins/FloatingMenu.js index de3a04ed1..0775b9211 100644 --- a/packages/tiptap/src/Plugins/FloatingMenu.js +++ b/packages/tiptap/src/Plugins/FloatingMenu.js @@ -91,7 +91,10 @@ class Menu { } hide(event) { - if (event && event.relatedTarget) { + if (event + && event.relatedTarget + && this.options.element.parentNode.contains(event.relatedTarget) + ) { return } diff --git a/packages/tiptap/src/Plugins/MenuBubble.js b/packages/tiptap/src/Plugins/MenuBubble.js index be32049be..21f510f10 100644 --- a/packages/tiptap/src/Plugins/MenuBubble.js +++ b/packages/tiptap/src/Plugins/MenuBubble.js @@ -146,8 +146,10 @@ class Menu { } hide(event) { - if (event && event.relatedTarget - && this.options.element.parentNode.contains(event.relatedTarget)) { + if (event + && event.relatedTarget + && this.options.element.parentNode.contains(event.relatedTarget) + ) { return }