From 63eaa79242ccb591b7933335cfb758d065952f53 Mon Sep 17 00:00:00 2001 From: Gaya KACI <163902005+kacigaya@users.noreply.github.com> Date: Mon, 12 Oct 2026 03:12:45 +0200 Subject: [PATCH] fix(web): context menus no longer scroll when they fit the window (#16776) --- apps/web/src/contextMenuFallback.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/src/contextMenuFallback.ts b/apps/web/src/contextMenuFallback.ts index db14ed8c860c26e0c1d9c1f0d7836c21dc35354d..1ba2be270eee1b7695f3a65079d098f95f5eff53 100644 --- a/apps/web/src/contextMenuFallback.ts +++ b/apps/web/src/contextMenuFallback.ts @@ -303,10 +303,12 @@ export function showContextMenuFallback( menu.dataset.level = String(level); const inner = document.createElement("div"); + // Fit the viewport (minus clampMenuPosition's 4px margins) so menus only + // scroll when the window is shorter than the menu itself. inner.className = - "max-h-[min(24rem,70vh)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1"; + "max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1"; inner.style.cssText = - "max-height:min(24rem,70vh);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;"; + "max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;"; for (const item of entries) { if (item.separatorBefore === true && inner.children.length > 0) { -- 2.54.0