diff --git a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts index a0e25157d4..14872a03ea 100644 --- a/packages/extension-bubble-menu/src/bubble-menu-plugin.ts +++ b/packages/extension-bubble-menu/src/bubble-menu-plugin.ts @@ -180,7 +180,7 @@ export class BubbleMenuView { } this.tippy?.setProps({ - getReferenceClientRect: () => { + getReferenceClientRect: this.tippyOptions?.getReferenceClientRect || (() => { if (isNodeSelection(state.selection)) { const node = view.nodeDOM(from) as HTMLElement @@ -190,7 +190,7 @@ export class BubbleMenuView { } return posToDOMRect(view, from, to) - }, + }), }) this.show() diff --git a/packages/extension-floating-menu/src/floating-menu-plugin.ts b/packages/extension-floating-menu/src/floating-menu-plugin.ts index 4ab1b0b83b..1440492e95 100644 --- a/packages/extension-floating-menu/src/floating-menu-plugin.ts +++ b/packages/extension-floating-menu/src/floating-menu-plugin.ts @@ -156,7 +156,7 @@ export class FloatingMenuView { } this.tippy?.setProps({ - getReferenceClientRect: () => posToDOMRect(view, from, to), + getReferenceClientRect: this.tippyOptions?.getReferenceClientRect || (() => posToDOMRect(view, from, to)), }) this.show()