From 70f06e78527ec9bfedb566d165f629956d54030e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 5 Oct 2024 11:08:50 +0200 Subject: [PATCH] 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 --- umap/static/umap/js/modules/ui/contextmenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {