Allow getReferenceClientRect to be overridden

Prefer using getReferenceClientRect in tippyOptions if available.
This allows modifying the position of the bubble menu in a different
location for block level elements, like above a table cell or a code block.
This commit is contained in:
fleonus
2022-03-31 22:03:34 +02:00
committed by GitHub
parent ab4a0e2507
commit 71c78ed53b

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