Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/web/src/contextMenuFallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,12 @@ export function showContextMenuFallback<T extends string>(
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) {
Expand Down
Loading