Open danmartinelluc opened 4 years ago
Are you using the latest NVDA version (2019.2.1)?
I've just updated to NVDA 2019.2.1 and can confirm that I'm seeing the same issue.
For this component I would also expect to hear "collapsed" or "expanded" when on the button: https://a11y-guidelines.orange.com/web_EN/exemples/simple-menu/simple-menu.html# might be a helpful example, and hopefully not too far away from the current implementation.
A simple accessible select menu with a correctly associated label would probably be recommended though, for example, if using the select for pagination:
<label for="pagenum">Page</label>
<div class="pageselect">
<select id="pagenum">
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
I've just updated to NVDA 2019.2.1 and can confirm that I'm seeing the same issue.
This sounds like it was working in prior versions of NVDA. Could you clarify whether this changed during a Material-UI or NVDA upgrade?
For this component I would also expect to hear "collapsed" or "expanded" when on the button: a11y-guidelines.orange.com/web_EN/exemples/simple-menu/simple-menu.html# might be a helpful example, and hopefully not too far away from the current implementation.
That example illustrates a menu which is different from a HTML select which is a combobox. I'm not convinced by the linked example anyway. It doesn't use any aria attributes to indicate a dropdown/popup/expansion character (e.g. aria-expanded or aria-haspopup) and the menu is only a list not a menu. The expected navigation is very different between lists and menus.
The issue is that the whole select/combobox story is in a very bad spot currently considering the ARIA spec. We would need to conduct our own research with assistive technology users for which we do not have the capacity.
I would recommend using the NativeSelect instead. You loose customizability but have the best a11y story until spec folks figure out how an alternative markup for a combobox should look like.
I'll check out why NVDA is breaking the navigation (which is working without NVDA running).
This sounds like it was working in prior versions of NVDA. Could you clarify whether this changed during a Material-UI or NVDA upgrade?
We actually came across this ourselves back in August 2019 with NVDA 2019.2.0 and Material UI v3, it took us a while to update to Material UI 4.7.0 😅 So this issue has been present since MUI v3 at least, and in NVDA 2019.2.0 at least.
I would recommend using the NativeSelect instead. You loose customizability but have the best a11y story until spec folks figure out how an alternative markup for a combobox should look like.
In fairness the native select looks pretty much exactly like that example markup above, so that will probably work for our purposes in the meantime. 👍
I can also confirm that this has been an issue for some time. While the current testing was done with the most recent version of NVDA/all other factors, the issue was first reported in May 2019.
TL;DR: This seems to be fixed as of 4.8.3. We did work on the a11y story of the Select component in the past months so this might have been fixed during that work.
It is working on
Printing NVDA speech viewer output after the page is loaded and the test is so that the focus is right before the first Select component and NVDA speech output is silent.
Aside: We should add a notice to check if the issue is present on the latest Material-UI version.
- Press enter (opens Select)
- Press enter (selects first value, closes Select and moves focus to Select)
This is the issue that we were seeing, just did a quick test with NVDA and Firefox - I wouldn't expect a screenreader user to have to hit "enter" twice in order to be able to use the arrow keys to navigate the menu. I'd expect something more like this:
This is the issue that we were seeing, just did a quick test with NVDA and Firefox - I wouldn't expect a screenreader user to have to hit "enter" twice in order to be able to use the arrow keys to navigate the menu. I'd expect something more like this:
I did this because the issue stated that it was only observable when a value was already selected:
With the Up and Down arrow keys navigate between the menu options (If a selection has already been made and is not just a placeholder, the issue can be seen here)
You do not need it to press enter twice to use arrow keys. This is pretty obvious if you read the content of the parantheses (second enter closes the select again). But as per issue description it was required. Please open a separate issue if you have different steps to reproduce.
The missing piece was the mode you were in. In focus mode everything is working as expected. In browse mode it is not though (which is where nvda is intercepting key strokes). We probably don't communicate quite right what kind of element you're navigating. I guess it's a combination of using a Popover for the listbox (and hiding the element referenced in aria-labelledby) and using roving tabindex instead of aria-activedescendant. https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html is working fine in NVDA in both modes.
I could reduce this problem using "just" react: https://codesandbox.io/s/nvda-browse-mode-listbox-nzukw
~It seems like NVDA is not supporting keyboard navigation using roving tabindex. It expects the listbox to have actual focus and the currently focused option to be marked with aria-activedescendant.~
~The good news for us is that a native <select size="3">
is also not navigateable with arrow keys in NVDA's browse mode. I'm opening an issue in the NVDA repository. I'm leaving this open to be aware of the issue. In the short term we can't do much because rewriting the component using aria-activedescendant is expensive and potentially breaking (considering :focus and :focus-within).~
Ok now I understood how you should navigate a
The issue is that with our implementation NVDA does not recognize that we "entered" the listbox. And when pressing enter again our implementation thinks we selected the value. We might have some leverage checking if we are in focus-visible state when enter is pressed. If not we know we didn't enter the listbox yet and presumable don't do anything to let NVDA know that it shouldn't intercept keydown. Otherwise do the usual (close, select and move focus).
First I need to check who NVDA prevents the focus-visible first.
I could reduce this problem using "just" react: https://codesandbox.io/s/nvda-browse-mode-listbox-nzukw
Just double-checking - I tested this example with NVDA and FireFox and I'm not seeing the same issue that I see on https://material-ui.com/components/selects/#select. Tab navigating to the example in https://codesandbox.io/s/nvda-browse-mode-listbox-nzukw will automatically fire the noise that indicates you have entered focus mode, and then the arrow keys can be used to navigate through the options as expected. Tab navigating to https://material-ui.com/components/selects/#select requires you to either hit "Enter" again or "NVDA + Space" (as per https://www.nvaccess.org/files/nvdaTracAttachments/455/keycommands%20with%20laptop%20keyboard%20layout.html) to enter focus mode and be able to navigate through the options with the arrow keys.
So to confirm - it's not an issue with just react, but it is an issue with MUI's [Select] component. Is that correct?
So to confirm - it's not an issue with just react, but it is an issue with MUI's [Select] component. Is that correct?
That's what the rest of the paragraph is for. Focus mode is working as expected. For browse mode we need to find a fix.
hi ,
Is the fix in place , i am also facing the same issue, where on clicking on Autocomplete using focus mode , i am not able to return to browse mode using Esc or Insert+Space
Hi,
Is any fix available for arrow navigation for select. It is not working with screen readers. (works on double enter which is not expected behavior).
@danmartinelluc I don't seem to have this issue in material-ui 5 but I do with NativeSelects and Select with native option
Current Behavior 😯
On Firefox, with NVDA enabled, if a menu item has been selected the up and down arrow keys will no longer navigate through the menu items. (In some circumstances navigation prior to a selection isn't possible, and only the first option can be chosen)
Expected Behavior 🤔
After selecting a menu item, keyboard navigation should be able to switch between menu items.
Steps to Reproduce 🕹
Issue can be reproduced on the select component page: https://material-ui.com/components/selects/
NVDA download here: https://www.nvaccess.org/download/
Steps:
Context 🔦
This impacts the accessibility of anything using a select component.
Your Environment 🌎