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:
@@ -180,7 +180,7 @@ export class BubbleMenuView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.tippy?.setProps({
|
this.tippy?.setProps({
|
||||||
getReferenceClientRect: () => {
|
getReferenceClientRect: this.tippyOptions.getReferenceClientRect || () => {
|
||||||
if (isNodeSelection(state.selection)) {
|
if (isNodeSelection(state.selection)) {
|
||||||
const node = view.nodeDOM(from) as HTMLElement
|
const node = view.nodeDOM(from) as HTMLElement
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user