Components: Focus drops to body if a menu item is removed while focused

Created on 7 Nov 2018  路  4Comments  路  Source: angular/components

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

P3 a11y materiamenu has pr

Most helpful comment

Any ideas when this fix will be merged in? Or a workaround to use in the meantime?

All 4 comments

Any ideas when this fix will be merged in? Or a workaround to use in the meantime?

Still experiencing this issue, has it been resolved?

Looks like there is no fix here up to now.

@crisbeto this should be fixed as of v9 when we switched menu to use @ContentChildren, right?

Was this page helpful?
0 / 5 - 0 ratings