Skip to content

Commit ee83e7c

Browse files
dcrjodleclaude
andcommitted
fix: make dropdown menu content scroll when taller than viewport
DropdownMenuContent (and SubContent) had overflow-hidden with no max-height, so a dropdown with more items than fit the viewport — e.g. the project selector in the New Plan dialog with many projects — clipped the lower items with no way to reach them. Cap the height to Radix's --radix-dropdown-menu-content-available-height and switch to overflow-y-auto so the list scrolls. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1792883 commit ee83e7c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/frontend/src/components/ui/dropdown-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const DropdownMenuSubContent = React.forwardRef<
6363
ref={ref}
6464
collisionPadding={8}
6565
className={cn(
66-
"z-50 min-w-[8rem] max-w-[calc(100vw-16px)] overflow-hidden rounded-box border bg-popover p-1 text-popover-foreground shadow-lg flex flex-col gap-0.5 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
66+
"z-50 min-w-[8rem] max-w-[calc(100vw-16px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto rounded-box border bg-popover p-1 text-popover-foreground shadow-lg flex flex-col gap-0.5 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
6767
className,
6868
)}
6969
{...props}
@@ -80,7 +80,7 @@ const DropdownMenuContent = React.forwardRef<
8080
ref={ref}
8181
collisionPadding={8}
8282
className={cn(
83-
"z-50 min-w-[8rem] max-w-[calc(100vw-16px)] overflow-hidden rounded-box border bg-popover p-1 text-popover-foreground shadow-md flex flex-col gap-0.5",
83+
"z-50 min-w-[8rem] max-w-[calc(100vw-16px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto rounded-box border bg-popover p-1 text-popover-foreground shadow-md flex flex-col gap-0.5",
8484
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
8585
className,
8686
)}

0 commit comments

Comments
 (0)