React Aria ListBox link support #5242
Replies: 1 comment 1 reply
-
For ListBox in particular, the main use case is not when used standalone but when used inside a ComboBox/autocomplete. For example, our documentation search uses links on its items to perform navigation, just like the Google autocomplete. Unfortunately, there's no way to have an element take two different roles (option and link), and a ComboBox is expected to have a ListBox attached which only supports options. We discussed potentially adding an additional aria-label or aria-roledescription to indicate that an item is a link but punted for the first release. Sometimes links are also just implementation details of the application/framework and not that relevant to the end user, so it is debatable whether it should always do that or only sometimes. Perhaps we will make improvements as we get more use cases and feedback. |
Beta Was this translation helpful? Give feedback.
-
Hi, all!
I was just curious — what was the rationale for
ListBox
(and by extensionSelect
andCombobox
) to support links? And when would this be recommended over a set ofLink
components? I've always been under the assumption that listboxes should not be used for navigation.From Adrian Roselli's Be Careful Using 'Menu':
From APG's Listbox pattern:
By attaching
role="option"
to an<a>
tag, its implicitlink
role is overridden, providing no information to a screen reader user, for instance, that what they're about to interact with will navigate them somewhere as demonstrated in Safari and VoiceOver below.ListBox
(<a href="" role="option">
)<a href="#>
Beta Was this translation helpful? Give feedback.
All reactions