From ca82cb3e146e73c95f2db1fccc5dafab82216342 Mon Sep 17 00:00:00 2001 From: Kasper Date: Fri, 29 Sep 2023 07:09:37 +0200 Subject: [PATCH] fix: set max hight on dropdown content to available height, and set a default collision padding of 8px --- .../dropdown-menu/dropdown-menu.tsx | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/packages/ui/src/components/dropdown-menu/dropdown-menu.tsx b/packages/ui/src/components/dropdown-menu/dropdown-menu.tsx index 19a5a61..031e078 100644 --- a/packages/ui/src/components/dropdown-menu/dropdown-menu.tsx +++ b/packages/ui/src/components/dropdown-menu/dropdown-menu.tsx @@ -42,12 +42,13 @@ SubMenuTrigger.displayName = "DropdownMenu.SubMenuTrigger" const SubMenuContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( +>(({ className, collisionPadding = 8, ...props }, ref) => ( , React.ComponentPropsWithoutRef ->(({ className, sideOffset = 8, align = "start", ...props }, ref) => ( - - - -)) +>( + ( + { + className, + sideOffset = 8, + collisionPadding = 8, + align = "start", + ...props + }, + ref + ) => ( + + + + ) +) Content.displayName = "DropdownMenu.Content" const Item = React.forwardRef<