Skip to content
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

[accessibility] Delegate focus when context menu has been opened #135

Open
Malvoz opened this issue Dec 9, 2020 · 2 comments
Open

[accessibility] Delegate focus when context menu has been opened #135

Malvoz opened this issue Dec 9, 2020 · 2 comments

Comments

@Malvoz
Copy link

Malvoz commented Dec 9, 2020

It'd be a great accessibility improvement for keyboard users if focus was delegated to the context menu's container.

https://developers.google.com/web/fundamentals/accessibility/a11y-for-teams#managing_focus:

When you change the content of the page, it's important to direct the user's attention by moving focus. A classic example of when this technique is useful is when opening a modal dialog. If a user relying on a keyboard presses a button to open a dialog and their focus is not moved into the dialog element, then their only course of action is to tab through the entire site until they eventually find the new control. By moving focus into the new content as soon as it appears, you can improve the efficiency of these users’ experiences.

A negative tabindex can be used to enable programmatic focus to the context menu's container:

https://webaim.org/techniques/keyboard/tabindex#zero-negative-one:

tabindex="-1" allows that element to receive programmatic focus. This means focus can be set to it using focus() scripting.

@Malvoz
Copy link
Author

Malvoz commented Apr 4, 2022

@danieldegroot2
Copy link

I would recommend adding highlights too, see mentioned issue. (These should be present with or without #136.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants