Skip to content

DropdownMenu V2: Focus goes out when pressing Tab key #58040

@t-hamano

Description

@t-hamano

Description

The DropdownMenu V2 component allows you to use the arrow keys to move between menus in the same hierarchy without losing focus. However, if you press Tab or Shift+Tab, the focus will be lost from those menus.

In Dropdown V1, the Tab key does not remove focus, so the behavior in V2 feels like a bug to me.

Step-by-step reproduction instructions

You can test this behavior on Storybook.

DropdownMenu V2

https://wordpress.github.io/gutenberg/?path=/story/components-experimental-dropdownmenu-v2--with-submenu

v2.mp4

DropdownMenu V1

https://wordpress.github.io/gutenberg/?path=/story/components-dropdownmenu--default

v1.mp4

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

Assignees

No one assigned

    Labels

    [Package] Components/packages/components[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