Skip to content

Commit

Permalink
fix: scrollable dropdown (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnithin authored Nov 27, 2024
1 parent 71e7308 commit d562e89
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions studio/src/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import * as React from "react";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
import {
CheckIcon,
ChevronRightIcon,
DotFilledIcon,
} from "@radix-ui/react-icons";
import { CheckIcon, ChevronRightIcon } from "@radix-ui/react-icons";

import { cn } from "@/lib/utils";

Expand Down Expand Up @@ -63,18 +59,21 @@ DropdownMenuSubContent.displayName =
const DropdownMenuContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
>(({ className, sideOffset = 4, children, ...props }, ref) => (
<DropdownMenuPrimitive.Portal>
<DropdownMenuPrimitive.Content
ref={ref}
sideOffset={sideOffset}
className={cn(
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
"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",
"scrollbar-custom max-h-[calc(var(--radix-dropdown-menu-content-available-height))] overflow-y-auto",
className,
)}
{...props}
/>
>
{children}
</DropdownMenuPrimitive.Content>
</DropdownMenuPrimitive.Portal>
));
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
Expand Down

0 comments on commit d562e89

Please sign in to comment.