Skip to content

Devtools elements accept focus even when closed #2375

@IanVS

Description

@IanVS

Describe the bug
When tabbing through my site, I noticed that there were several hidden elements that took focus. I traced them down to the react-query devtools, which, even though it was closed, took focus.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a page where the devtools is included, but not open.
  2. Open and close the devtools to set focus on the devtools button.
  3. Press shift-tab to focus the previous element.
  4. Run document.activeElement in the devtools and confirm that the Remove button of the devtools is focused.

Expected behavior
I expect to be able to tab through elements on the page, including the button to open and close the query devtools, but not tab through the devtools itself when it is closed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions