fix: insert contextmenu in the offsetParent

Otherwise when parent is a dialog, if the the contextemenu is in
the body, it will be below the dialog forever
This commit is contained in:
Yohan Boniface 2024-10-05 11:08:50 +02:00
parent 89c13a3b7e
commit 70f06e7852

View file

@ -38,7 +38,8 @@ export default class ContextMenu extends Positioned {
this.container.appendChild(li)
}
}
document.body.appendChild(this.container)
const parent = document.elementFromPoint(event.clientX, event.clientY).offsetParent
parent.appendChild(this.container)
if (this.options.fixed) {
this.setPosition({ left, top })
} else {