-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(#4080): ComboBox: aXe throws an error when the virtualized listbox is scrollable #4081
base: main
Are you sure you want to change the base?
Conversation
Build successful! 🎉 |
Wouldn't that only "fix" it if you aren't running aXe on mobile? Also I think this makes the items inside the combobox tabbable in some cases, which probably isn't desirable. Seems wrong to me to make items that will receive focus via aria-activedescendant DOM focusable - the whole point of using that attribute is so they aren't. Can we file a bug against aXe for this? |
Build successful! 🎉 |
This is kind of a peculiar case about which the WAI-ARIA spec is unclear. If we don't override
role="combobox" also means that we no longer need to remove aria-expanded from the input: #4078, which @jnurthen has logged as a WAI-ARIA spec issue: w3c/aria#1875.
I kind of think that if Is it essential to override cc @jnurthen, @LFDanLu and @devongovett |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'identifier', name: 'Column' } |
I think aria-expanded doesn't really make much sense for mobile combo box anyway, because there is no concept of expanding or collapsing it. The listbox with suggestions is a sibling of the search box, and doesn't expand or collapse, so it would always announce as expanded which isn't very useful.
Feels weird to me since that action would not actually work as the screen reader is describing it. The expanding/collapsing aspect of a combobox seems to be an assumption of screen readers that doesn't apply here. Regardless, I tested this in Chrome with VoiceOver and it seems that you cannot navigate with Control + Option + arrow keys anymore after this change. VoiceOver focuses the option element within the ListBox, which causes DOM focus to move away from the input, and the popover to close. Before, DOM focus would stay on the input and only the virtual cursor would move. Also it wouldn't solve the original issue which was related to MobileComboBox because the change doesn't affect mobile devices (the |
@@ -115,9 +115,13 @@ function testSearchAutocompleteOpen(searchAutocomplete, listbox, focusedItemInde | |||
expect(items[1]).toHaveTextContent('Two'); | |||
expect(items[2]).toHaveTextContent('Three'); | |||
|
|||
expect(listbox).not.toHaveAttribute('tabIndex'); | |||
expect(listbox).toHaveAttribute('tabIndex', typeof focusedItemIndex === 'undefined' ? '0' : '-1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we expect focusedItemIndex to be undefined at this point? or is this a React 16/17/18 difference?
8cb1a5d
to
3013156
Compare
a79adcf
to
3013156
Compare
Closes #4080
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project:
Adobe/Accessibility