From 9dde71716f2bc28785e64aaa0a60e790edd2924c Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 15 Mar 2023 14:51:49 -0400 Subject: [PATCH] Improve DropdownMenu API --- app/soapbox/components/dropdown-menu/dropdown-menu.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/soapbox/components/dropdown-menu/dropdown-menu.tsx b/app/soapbox/components/dropdown-menu/dropdown-menu.tsx index f4d885b7f..a5714ff68 100644 --- a/app/soapbox/components/dropdown-menu/dropdown-menu.tsx +++ b/app/soapbox/components/dropdown-menu/dropdown-menu.tsx @@ -271,6 +271,10 @@ const DropdownMenu = (props: IDropdownMenu) => { }; }, [refs.floating.current]); + if (items.length === 0) { + return null; + } + return ( <> {children ? (