Solutionunvalidated
Use a single ref that stores an array of item nodes (via ref callbacks) and update an index-based selection state on keydown. On arrow navigation, focus the corresponding node from the ref array (e.g., refs.current[selectedIndex].focus()).
7d552bc6-b707-42bb-84c7-1939c03aa020
Use a single ref that stores an array of item nodes (via ref callbacks) and update an index-based selection state on keydown. On arrow navigation, focus the corresponding node from the ref array (e.g., refs.current[selectedIndex].focus()).