Skip to content

[EuiContextMenu][KEYBOARD]: Focus needs to be returned to button when closing context menu #5404

@thomheymann

Description

@thomheymann

cc @1Copenut

Focus isn't returned to the triggering button element when closing a context menu.

Steps to reproduce

  1. Go to https://elastic.github.io/eui/#/navigation/context-menu
  2. Click "click me to load a context menu" button.
  3. Tab through the menu, then press ESC to close the menu
  4. Verify the body tag has keyboard focus (document.activeElement)

Plain EuiPopover components work fine. As soon as you add an EuiContextMenu to the EuiPopover the focus isn't returned correctly to the trigger button element when closing the context menu.

Screenshot 2021-11-23 at 13 13 17

Related issues

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions