Retro Bulletin Board Systems on atproto. Web app and TUI. lazy mirror of alyraffauf/atbbs atbbs.xyz
forums python tui atproto bbs
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

web: remove circular dep in dropdowns

+3 -1
+3 -1
web/src/hooks/useDropdown.ts
··· 6 6 const [focused, setFocused] = useState(false); 7 7 const [activeIndex, setActiveIndex] = useState(-1); 8 8 const blurTimeout = useRef<ReturnType<typeof setTimeout>>(undefined); 9 + const onSelectRef = useRef(onSelect); 10 + onSelectRef.current = onSelect; 9 11 10 12 function onFocus() { 11 13 clearTimeout(blurTimeout.current); ··· 34 36 ); 35 37 } else if (event.key === "Enter" && activeIndex >= 0) { 36 38 event.preventDefault(); 37 - onSelect(activeIndex); 39 + onSelectRef.current(activeIndex); 38 40 } else if (event.key === "Escape") { 39 41 setFocused(false); 40 42 setActiveIndex(-1);