-
-
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
Add keyboard behaviors to menubar #3220
base: develop
Are you sure you want to change the base?
Add keyboard behaviors to menubar #3220
Conversation
…down to left menu
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.
Thanks so much for diving into this and for providing detailed references/explanations—this is really awesome to see so far and I feel like it's a great start to implementing keyboard accessibility! :)
I'm not entirely familiar with best practices, so I didn't realize that it's preferred to use Arrow Keys vs. Tab when navigating through a menu bar! I personally feel that once the linting warnings are addressed, this may be ready to go!
I'm also going to ping @calebfoss and @nickmcintyre, who have done accessibility work with the p5.js library, to see if they might have any thoughts!
…with up and down arrows
thanks! yes i didn't realize arrow keys should be used either until reviewing the wai aria guide. i learned that you can tab to get into the menubar but once that component is focused, the expectation for keyboard users is that arrow keys would be used to get to the other items. would love to get others' thoughts. as a reference, the initial commits in this pr allow navigation with the left and right arrow keys: i also just pushed some recent commits that begin to add functionality for up and down arrows. there's some work to be done; for example, when first opening a submenu, the 1st item doesn't get a focus outline for some reason; and the keyboard behaviors are not all there (pressing the left and right keys while in a submenu should close the current submenu and focus the next one, expanding if it is another submenu; additionally, the down and up keys should both open the submenu and focus the first or last element respectively). there are also lots of code changes so i'm sure a refactor would be helpful down the line. i'll keep poking at it and drop an update here. |
@tespin my apologies for the delay! Your upgrades work well overall. As you pointed out, the Left and Right Arrow keys behave differently in a submenu than suggested by WAI-ARIA:
Actions 1 and 3 seem particularly helpful. Do you have a sense of what changes are needed to implement them? |
@nickmcintyre no worries, thanks for getting back to me! i spent some time on it today. my idea was to add an i'm learning that it has to do with react's asynchronous updates but i'm not sure if i'm accessing the current state correctly. should i not do a functional state update with |
hmmm. A functional state update with |
ah i see. i think i did have some issues implementing certain changes with the current component, so a refactor would make sense. if there isn't one already, i'll start putting together a separate issue to start a conversation on what a refactor might look like. thanks for your input! |
Progress on #2933
Tasks:
Changes:
Hi all! I'm using this PR to work on implementing keyboard behaviors for the editor's menubar. This will support the accessibility features implied by the recently-added ARIA attributes in #3191. Currently I've added a roving tab focus and changing the focused item with the left and right keys. The language drop down was also moved to the left side of the menu.
I'm referencing the implementation details for the menubar in a sandbox linked below. Would love any feedback if anyone has some!
References:
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123