authorgravatar for 163902005+kacigaya@users.noreply.github.comGaya KACI <163902005+kacigaya@users.noreply.github.com> 2026-10-12 03:12:45+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-12 01:12:45+00:00
log63eaa79242ccb591b7933335cfb758d065952f53
tree9730e734a8fc535dc2d583dfa6d64d5401e59eee
parent6a99eb3f08f190d514c924dbcd562ee58b365762
signature Signed by PGP key B5690EEEBB952194

fix(web): context menus no longer scroll when they fit the window (#16776)


1 files changed, 4 insertions(+), 2 deletions(-)

apps/web/src/contextMenuFallback.ts+4-2
...@@ -303,10 +303,12 @@ export function showContextMenuFallback<T extends string>(...@@ -303,10 +303,12 @@ export function showContextMenuFallback<T extends string>(
303 menu.dataset.level = String(level);303 menu.dataset.level = String(level);
304304
305 const inner = document.createElement("div");305 const inner = document.createElement("div");
306 // Fit the viewport (minus clampMenuPosition's 4px margins) so menus only
307 // scroll when the window is shorter than the menu itself.
306 inner.className =308 inner.className =
307 "max-h-[min(24rem,70vh)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1";309 "max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1";
308 inner.style.cssText =310 inner.style.cssText =
309 "max-height:min(24rem,70vh);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;";311 "max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;";
310312
311 for (const item of entries) {313 for (const item of entries) {
312 if (item.separatorBefore === true && inner.children.length > 0) {314 if (item.separatorBefore === true && inner.children.length > 0) {