diff --git a/rsconcept/frontend/src/components/dropdown/use-dropdown.ts b/rsconcept/frontend/src/components/dropdown/use-dropdown.ts index df14cc1f..0364a66c 100644 --- a/rsconcept/frontend/src/components/dropdown/use-dropdown.ts +++ b/rsconcept/frontend/src/components/dropdown/use-dropdown.ts @@ -2,18 +2,21 @@ import { useRef, useState } from 'react'; -import { useClickedOutside } from '@/hooks/use-clicked-outside'; - export function useDropdown() { const [isOpen, setIsOpen] = useState(false); - const ref = useRef(null); + const ref = useRef(null); - useClickedOutside(isOpen, ref, () => setIsOpen(false)); + function handleBlur(event: React.FocusEvent) { + if (!ref.current?.contains(event.relatedTarget as Node)) { + setIsOpen(false); + } + } return { ref, isOpen, setIsOpen, + handleBlur, toggle: () => setIsOpen(!isOpen), hide: () => setIsOpen(false) }; diff --git a/rsconcept/frontend/src/features/help/pages/manuals-page/topics-dropdown.tsx b/rsconcept/frontend/src/features/help/pages/manuals-page/topics-dropdown.tsx index 09e7b236..334394b5 100644 --- a/rsconcept/frontend/src/features/help/pages/manuals-page/topics-dropdown.tsx +++ b/rsconcept/frontend/src/features/help/pages/manuals-page/topics-dropdown.tsx @@ -30,6 +30,7 @@ export function TopicsDropdown({ activeTopic, onChangeTopic }: TopicsDropdownPro return (
-
+
{ownerSelector.isOpen ? (
diff --git a/rsconcept/frontend/src/features/library/components/menu-role.tsx b/rsconcept/frontend/src/features/library/components/menu-role.tsx index c695311a..0ceb3d3d 100644 --- a/rsconcept/frontend/src/features/library/components/menu-role.tsx +++ b/rsconcept/frontend/src/features/library/components/menu-role.tsx @@ -44,7 +44,7 @@ export function MenuRole({ isOwned, isEditor }: MenuRoleProps) { } return ( -
+