ComboBox: aXe throws an error when the virtualized listbox is scrollable #4080
Description
🐛 Bug Report
While testing MobileComboBox variant that opens within a Tray using ComboBox example with many items example, aXe throws an error when the virtualized listbox is scrollable, Scrollable region must have keyboard access, because the listbox and any of its descendant option items do not have a tabIndex
.
This relates to the following commit, which removes tabIndex
from the listbox and descendant option items for virtualized listboxes that use aria-activedescendant
: Remove tabIndex from listbox and options when using virtual focus: iOS 14 moves real DOM focus even with aria-activedescendant otherwise.
See the code comments for this behavior as well:
react-spectrum/packages/@react-aria/selection/src/useSelectableItem.ts
Lines 151 to 164 in 0f953ca
and:
react-spectrum/packages/@react-aria/selection/src/useSelectableCollection.ts
Lines 390 to 397 in 0f953ca
🤔 Expected Behavior
aXe should not throw this false positive on platforms where it is not necessary to remove the tabIndex
.
😯 Current Behavior
aXe throws an error when the virtualized listbox is scrollable, Scrollable region must have keyboard access, because the listbox and any of its descendant option items do not have a tabIndex
.
💁 Possible Solution
We might be able to safely remove the tabIndex
attributes for a virtualized listbox only on mobile devices.
🔦 Context
Accessibility audit
🌍 Your Environment
Software | Version(s) |
---|---|
react-spectrum | @adobe/[email protected] |
Browser | Google Chrome Version 110.0.5481.77 (Official Build) (arm64) |
Operating System | macOS Ventura 13.2.1 (22D68) |
🧢 Your Company/Team
Adobe/Accessibility
🕷 Tracking Issue (optional)
A11Y-5821