From fd91ffaa0eb3023076bfd09256943749995fbdd0 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 7 Oct 2024 08:54:11 -0700 Subject: [PATCH] Remove broken hover behavior --- apps/web/src/components/profileDropdown.tsx | 29 +-------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/apps/web/src/components/profileDropdown.tsx b/apps/web/src/components/profileDropdown.tsx index ceefef873..6d35f2022 100644 --- a/apps/web/src/components/profileDropdown.tsx +++ b/apps/web/src/components/profileDropdown.tsx @@ -18,31 +18,9 @@ export function ProfileDropdown() { const { user } = useAuth(); const buttonRef = useRef(null); const dropdownRef = useRef(null); - const timeoutDuration = 200; - let timeoutId: ReturnType; if (!user) return null; - const openMenu = () => buttonRef?.current?.click(); - const closeMenu = () => - dropdownRef?.current?.dispatchEvent( - new KeyboardEvent("keydown", { - key: "Escape", - bubbles: true, - cancelable: true, - }), - ); - - const onMouseEnter = (closed?: boolean) => { - if (timeoutId) clearTimeout(timeoutId); - if (closed) openMenu(); - }; - const onMouseLeave = (open: boolean) => { - if (open) { - timeoutId = setTimeout(() => closeMenu(), timeoutDuration); - } - }; - return ( {({ open }) => ( @@ -55,14 +33,11 @@ export function ProfileDropdown() { ? "rounded-b-none rounded-t bg-slate-800 text-white" : "text-muted rounded", )} - onClick={openMenu} as={Link} href={`/users/${user.username}`} - onMouseEnter={() => onMouseEnter(!open)} - onMouseLeave={() => onMouseLeave(open)} > Open user menu -
+
@@ -77,8 +52,6 @@ export function ProfileDropdown() { > onMouseEnter()} - onMouseLeave={() => onMouseLeave(open)} static className="absolute right-0 z-40 mt-0 w-48 origin-top-right divide-y divide-slate-700" >