From 882c71f2ba30f799f3e471492f9247fd798f3870 Mon Sep 17 00:00:00 2001 From: Decobus Date: Sun, 20 Jul 2025 01:55:22 -0400 Subject: [PATCH] Revert dropdown to simpler positioning approach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplified dropdown positioning to fix layering issues: - Reverted to absolute positioning with inline z-index styles - Added explicit z-index to dropdown container in streams page - Removed complex fixed positioning logic that was causing problems This should resolve dropdown visibility issues while maintaining proper positioning. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/streams/page.tsx | 2 +- components/Dropdown.tsx | 71 +++++++++++++---------------------------- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/app/streams/page.tsx b/app/streams/page.tsx index e92feeb..fd72bea 100644 --- a/app/streams/page.tsx +++ b/app/streams/page.tsx @@ -235,7 +235,7 @@ export default function AddStream() { Team
-
+
(null); - const buttonRef = useRef(null); const [isOpen, setIsOpen] = useState(controlledIsOpen ?? false); - const [dropdownPosition, setDropdownPosition] = useState({ top: 0, left: 0, width: 0 }); useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if (!dropdownRef.current || !(event.target instanceof Node)) return; - if (dropdownRef.current && !dropdownRef.current.contains(event.target) && - buttonRef.current && !buttonRef.current.contains(event.target)) { + if (dropdownRef.current && !dropdownRef.current.contains(event.target)) { if (onToggle) onToggle(false); else setIsOpen(false); } @@ -43,17 +40,6 @@ export default function Dropdown({ }; }, [controlledIsOpen, isOpen, onToggle]); - useEffect(() => { - if ((controlledIsOpen ?? isOpen) && buttonRef.current) { - const rect = buttonRef.current.getBoundingClientRect(); - setDropdownPosition({ - top: rect.bottom + window.scrollY, - left: rect.left + window.scrollX, - width: rect.width - }); - } - }, [controlledIsOpen, isOpen]); - const activeOption = options.find((option) => option.id === activeId) || null; const handleSelect = (option: { id: number }) => { @@ -68,41 +54,30 @@ export default function Dropdown({ }; return ( - <> -
- -
+ + + {(controlledIsOpen ?? isOpen) && ( -
+
{options.length === 0 ? (
No teams available @@ -120,6 +95,6 @@ export default function Dropdown({ )}
)} - +
); } \ No newline at end of file