diff --git a/web/contextMenu.ts b/web/contextMenu.ts index 96a2215..e3755c7 100644 --- a/web/contextMenu.ts +++ b/web/contextMenu.ts @@ -83,7 +83,7 @@ class ContextMenu { ? 2 - menuBounds.height // context menu fits above : -2 - (menuBounds.height - (frameBounds.height - (event.pageY - frameBounds.top))); // Overlap the context menu vertically with the cursor menu.style.left = (frameElem.scrollLeft + Math.max(event.pageX - frameBounds.left + relativeX, 2)) + 'px'; - menu.style.top = (frameElem.scrollTop + Math.max(event.pageY - frameBounds.top + relativeY, 2)) + 'px'; + menu.style.top = Math.max(event.clientY - frameBounds.top + relativeY, 2) + 'px'; menu.style.opacity = '1'; this.elem = menu; this.onClose = onClose; diff --git a/web/styles/contextMenu.css b/web/styles/contextMenu.css index d0e42b2..7688636 100644 --- a/web/styles/contextMenu.css +++ b/web/styles/contextMenu.css @@ -1,13 +1,13 @@ .contextMenu{ display:block; - position:absolute; + position:fixed; background-color:var(--vscode-menu-background); box-shadow:0 1px 4px 1px var(--vscode-widget-shadow); color:var(--vscode-menu-foreground); list-style-type:none; margin:0; padding:4px 0; - z-index:10; + z-index:13; -webkit-user-select:none; user-select:none; }