Merge pull request #2668 from fleon/patch-1

fix: Allow tippyOptions.getReferenceClientRect in bubble menu to be overridden
This commit is contained in:
bdbch
2022-04-10 18:01:32 +02:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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()

View File

@@ -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()