facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.58k stars 8.33k forks source link

Keyboard focus is lost when exiting the dropdown #8697

Closed kagankan closed 1 year ago

kagankan commented 1 year ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Thank you, maintainers and contributors, for this useful framework!


Bug: Keyboard focus is lost when exiting the dropdown (e.g. language switcher).

https://user-images.githubusercontent.com/34136752/220798258-75584e75-efd3-4f9b-b9f3-fcd00f7d401c.mp4

Reproducible demo

https://stackblitz.com/edit/github-segjfa?file=docusaurus.config.js

Steps to reproduce

  1. Press Tab, Tab, ... to focus language switcher.
  2. Press Enter to open dropdown.
  3. Press Tab, Tab, ... to move focus.
  4. When exiting the dropdown, focus is lost.

Expected behavior

Focus moves to theme switcher.

Actual behavior

Focus is lost.

Your environment

Self-service

slorber commented 1 year ago

Can't repro on our own website: https://docusaurus.io/

https://user-images.githubusercontent.com/749374/220872212-09696f95-192f-4128-b026-2f1d069a140f.mp4

But I do reproduce on your StackBlitz sandbox too, weird 😅 It's like there's an extra item in between that steals the focus.

Have you tried a production build of Docusaurus?