facebook / facebook/docusaurus

Hamburger menu for left-side navigation cannot be accessed by keyboard - Keyboard Navigation - Accessibility

Ouverte
#8,095 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug domain: a11y
Langage dominant
TypeScript
Étoiles
66.2k
Forks
10k
Merge moyen
1 j 3 h
PR mergées (30 j)
52

Description

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### Description

On low resolutions/mobile devices, a hamburger menu replaces the sidebar on the left. This hamburger menu cannot be correctly accessed with the keyboard:

when you click it with the mouse, it opens and stays open and allows
when you try to access it with the keyboard (tab -> return), it does not open or does not stay open
when you manage to open it, it is hard to close it or navigate it with keyboard

![image](https://user-images.githubusercontent.com/48523132/189927640-cfa2a7a2-f930-458a-8c52-25df1bd3f854.png)
![image](https://user-images.githubusercontent.com/48523132/189927667-c7785502-000d-4154-8609-b41812d5519d.png)

For comparison, here is a page with a similar design on low res where you can access the hamburger menu with keyboard and close it by pressing esc:
https://support.microsoft.com/de-de/office/erstellen-eines-organigramms-in-powerpoint-mithilfe-einer-vorlage-d361c25f-665e-4d2c-bfc9-133763511a85?ui=de-DE&rs=de-DE&ad=DE

### Reproducible demo

Thank you

### Steps to reproduce

When you press enter or space on the hamburger menu it should open and the active link should go to the first item.
Then navigation with tab should work within the menu. However pressing shift-tab to the close menu button should be possible to navigate out of the menu.

### Expected behavior

When you press enter or space on the hamburger menu it should open and the active link should go to the first item.
Then navigation with tab should work within the menu. However pressing shift-tab to the close menu button should be possible to navigate out of the menu.

### Actual behavior

Now when your focus is on the hamburger menu and then you press TAB twice the menu opens which is already strange.
The hamburger menu should only open when you are focussed on it and press enter or space then.

### Your environment

- Public source code: /
- Public site URL: https://docs.boc-group.com/adonis/en/
- Docusaurus version used: 2.0.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome (latest)
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows

### Self-service

- [ ] I'd be willing to fix this bug myself.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.