Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[Accessibility]: Global <Menu>: Focus isn't moved to first item when menu is opened #36350

Open
3 of 4 tasks
umpox opened this issue Jun 1, 2022 · 3 comments · Fixed by #36915
Open
3 of 4 tasks

[Accessibility]: Global <Menu>: Focus isn't moved to first item when menu is opened #36350

umpox opened this issue Jun 1, 2022 · 3 comments · Fixed by #36915
Labels
accessibility a11y / accessibility estimate/2d frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. gitstart Contract partner wcag/2.1/fixing wcag/2.1

Comments

@umpox
Copy link
Contributor

umpox commented Jun 1, 2022

Audit type

Keyboard navigation

User journey audit issue

No response

Problem description

We're having issues when opening menus where it isn't obvious where the focus is, and requires additional steps to select certain items.

For example, see how it isn't immediately obvious in our Menu component from Storybook:
InaccessibleMenu

Expected behavior

When opening a menu with a keyboard, the first item should always be focused.

See this example: https://w3c.github.io/aria-practices/examples/menu-button/menu-button-links.html
AccessibleMenu

Additional details

Related issues:

Assigning labels

  • Please give this issue an estimate by applying a label like estimate/Xd, where X is the estimated number of days it will take to complete.
  • If this issue is specific to a specific Sourcegraph product, please assign the appropriate team label to this issue.
  • If this issue will require input from designers in order to complete, please assign the label needs-design.
  • If you are confident that this issue should be fixed by GitStart, please assign the label gitstart.

Owner

This issue will be fixed by GitStart. I have assigned the label 'gitstart' and added the assignee 'gitstart-sourcegraph'.

@gitstart-app
Copy link
Contributor

gitstart-app bot commented Jun 1, 2022

Here is the GitStart Ticket for this issue: https://app.gitstart.com/clients/sourcegraph/tickets/SG-36350

@umpox
Copy link
Contributor Author

umpox commented Jul 6, 2022

Re-opening this.

We have had to revert due to performance issues when using this change with our rendering logic (https://github.com/sourcegraph/sourcegraph/pull/38298)

Will keep this open and aim to address this problem further.

@gitstart-sourcegraph No need for any immediate action, we'll investigate this further first

@felixfbecker
Copy link
Contributor

felixfbecker commented Nov 8, 2022

Relevant spec:

When a menu opens, keyboard focus is placed on the first menu item. To be keyboard accessible, you need to manage focus for all descendants: all menu items within the menu are focusable. The menu button which opens the menu and the menu items, rather than the menu itself, are the focusable elements.

@felixfbecker felixfbecker changed the title [Accessibility]: Global Menu: Focus isn't correctly captured when menus are opened [Accessibility]: Global Menu: Focus isn't moved to first item when menu is opened Nov 8, 2022
@felixfbecker felixfbecker changed the title [Accessibility]: Global Menu: Focus isn't moved to first item when menu is opened [Accessibility]: Global <Menu>: Focus isn't moved to first item when menu is opened Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility a11y / accessibility estimate/2d frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. gitstart Contract partner wcag/2.1/fixing wcag/2.1
Projects
No open projects
Status: Done
Status: Done
3 participants