adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.1k stars 1.14k forks source link

GridList should support autoFocus #7105

Open snowystinger opened 2 months ago

snowystinger commented 2 months ago

ListBox supports autoFocus for use in popovers. We should add the same support to GridList. See discussion for more details and use case.

Discussed in https://github.com/adobe/react-spectrum/discussions/7100

Originally posted by **zommerberg** September 27, 2024 Hello, I am building a custom single and multi select component that also has a search to it. Similar to: ![image](https://github.com/user-attachments/assets/df64cd00-d771-42ee-8f02-4a1565ffb7bb) For this I am using a DialogTrigger + Popover for the overlays and inside render a GridList. So far so good, but there seems to be no way to automatically focus on the GridList when I open the modal. I have to click "Tab" in order to make the GridList focusable but i want it to behave similarly to normal select where you open the modal and can directly navigate with up and down arrows.
LFDanLu commented 1 month ago

The work being done in https://github.com/adobe/react-spectrum/pull/7181 will most likely be related since we hope to be able to use the Autocomplete wrapper with any collection component in general.