Skip to content

DropdownMenu: accessibility fix #2507

@PosikBoy

Description

@PosikBoy

If a DropdownMenu contains a submenu, it currently opens on hover when the user moves the mouse over the item that triggers the submenu. However, the submenu is not accessible from the keyboard because it has no keyboard event handlers to open it.

As a result, this makes the submenu inaccessible for screen reader users — the submenu simply cannot be reached without a mouse.

I propose adding the necessary event handlers so that the submenu can also be opened via click (which works with Enter on the focused element and through standard screen reader interaction patterns).

Reproduction

https://stackblitz.com/edit/gravity-ui-uikit-example-jpx7ukl6?file=src%2FApp.tsx

Steps to reproduce

Focus the button that opens submenu using tab. Than try to open submenu from keyboard, using Enter, Space etc.

Expected: opened menu
Receiver: not opened menu :(

Environment

MacOS, yandex browser

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions