diff --git a/umap/static/umap/js/modules/ui/contextmenu.js b/umap/static/umap/js/modules/ui/contextmenu.js index f02e2b1a..d385e492 100644 --- a/umap/static/umap/js/modules/ui/contextmenu.js +++ b/umap/static/umap/js/modules/ui/contextmenu.js @@ -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 {