Skip to content

Focus is lost after selecting option from "Select Menu" dropdown #38169

@tellthemachines

Description

@tellthemachines

Description

In the Navigation Block toolbar, the "Select Menu" button opens a dropdown from where a different menu can be selected. Selecting a menu from that dropdown causes the dropdown to close, but when it closes keyboard focus is reset to the document body.

Focus should instead go back to the "Select Menu" button in the toolbar, or perhaps to the block itself.

Possibly due to #39044

Edit: Now it only happens when creating a new menu or importing from a classic one.

Step-by-step reproduction instructions

  1. Create a Navigation block, and make sure the site has more than one navigation menu already.
  2. In the Navigation block toolbar, click "Select Menu" and choose a menu from the dropdown.
  3. Note focus is no longer on the block when the dropdown closes.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Labels

Needs DevReady for, and needs developer efforts[Block] NavigationAffects the Navigation Block[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions