Skip to content

Focus drops to body if a menu item is removed while focused #14028

Closed
@diminutivesloop

Description

@diminutivesloop

Bug, feature request, or proposal:

Bug

What is the expected behavior?

It should be possible to use the MatMenuTrigger.menuOpened event to load new menu data when a menu is opened.

What is the current behavior?

If menu data changes after Mat-Menu is opened the menu loses focus and the user can't navigate the menu with arrow keys unless they tab back to the menu.

What are the steps to reproduce?

https://stackblitz.com/edit/mat-menu-on-open-update-issue

What is the use-case or motivation for changing an existing behavior?

Sometimes it is desirable to load menu data only when the user clicks the menu to avoid unnecessary network requests. Doing this should not break accessibility.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material: 7.0.3
Angular: 7.0.3

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/menu

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions