-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Up/Down arrow keys not working on dropdown #2933
Comments
@lindapaiste Initially, I attempted to add an event listener in the useEffect inside NavDropdownMenu.jsx, but it doesn't seem to be doing the trick. I noticed we already have useKeyDownHandlers utility in the codebase. Do you think it could be leveraged for this use case? |
@mohitbalwani I think this not a bug but intentional |
@mohitbalwani I also think it's intentional as we can move backward using Shift+Tab |
It's not a "bug" but it's a good feature request! Right now everything is navigable using the Tab key but I have wanted to support using arrow keys as a secondary method. There's a @mohitbalwani yes you should be able to make use of We want the arrows to do nothing if the component is not focused. When a dropdown is expanded, you would be able to use the up and down arrows to move up or down the list of items. I'm not sure what's supposed to happen if you're on the last item of the list and then press the down arrow. Should it loop back around to the start? Close the dropdown? It would be good if we can find some relevant ARIA guidelines so we know how to handle every case. |
First things first, let's make sure that our HTML markup is as descriptive as possible. We want the browser to understand what these elements represent and how to interact with them. We might not need to use a lot of explicit event handling. I'm not sure if this section is describing behavior that's automatic? https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menu_role#keyboard_interactions We want the This should be the first course of action, before adding any event handlers. |
I would like to work on this issue my initial action will be starting with (Nav.jsx) p5.js-web-editor/client/modules/IDE/components/Header/Nav.jsx And then changing the usage of ul and li tag with menu and menu item , |
@Prateek-Fst I started working on the ARIA markup in a draft PR #2968 but I didn’t finish. You can fork that branch and address the “pending” items listed in that PR. |
according to the recent ARIA authoring guide, wrapping from the last to first or vice versa is optional depending on the use case. I think that since it's a fairly small set of options in the dropdown menus, wrapping can make sense here. As far as I've learned, menus should only be closed via keyboard if focus is moved to a different item in the I just finished adding ARIA markup a few days ago so I'm giving this issue some attention now, though if anyone else has already started working on it please chime in! |
have you had a chance to work on this more? Probably important to note though, when I press escape the menu stays open and appears to lose focus, so the only way I can make it go away is to click somewhere else in code then put the cursor back where I was to continue typing. i.e. menu stays and keyboard input gets lost. |
hi @IshinoAkuma , i just finished refactoring the component and am finalizing keyboard behaviors in #3320. thanks for noting the windows behavior, that looks very inconvenient and definitely not accessible! i'm hoping to be ready with the PR some time next week and will test the behaviors across devices. |
p5.js version
No response
What is your operating system?
Mac OS
Web browser and version
No response
Actual Behavior
Up/Down arrow keys are not working on dropdown items.
Expected Behavior
We should be able to navigate through dropdown items using up/down arrow keys.
Steps to reproduce
Steps:
The text was updated successfully, but these errors were encountered: