diff --git a/.changeset/pink-avocados-stare.md b/.changeset/pink-avocados-stare.md new file mode 100644 index 000000000..072d045df --- /dev/null +++ b/.changeset/pink-avocados-stare.md @@ -0,0 +1,9 @@ +--- +"@tiptap/extension-floating-menu": patch +"@tiptap/extension-bubble-menu": patch +"@tiptap/react": patch +"@tiptap/vue-2": patch +"@tiptap/vue-3": patch +--- + +Fixes an issue where the bubble and flaoting menus on blur would remount diff --git a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts index 1bcfe7109..b699079a1 100644 --- a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts +++ b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts @@ -156,6 +156,12 @@ export class BubbleMenuView { return } + if ( + event?.relatedTarget === this.editor.view.dom + ) { + return + } + this.hide() } diff --git a/packages/extension-floating-menu/src/floating-menu-plugin.ts b/packages/extension-floating-menu/src/floating-menu-plugin.ts index 5db7d7a92..07797f8bc 100644 --- a/packages/extension-floating-menu/src/floating-menu-plugin.ts +++ b/packages/extension-floating-menu/src/floating-menu-plugin.ts @@ -123,6 +123,12 @@ export class FloatingMenuView { return } + if ( + event?.relatedTarget === this.editor.view.dom + ) { + return + } + this.hide() }