Mat-menu not allowing key strokes with menu items from components
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-7-mat-menu (works) https://stackblitz.com/edit/angular-9-mat-menu (broken)
Steps to reproduce:
- Set up a button to be used with a mat-menu
- In the mat-menu, use 2 buttons as well as use a custom component that has just a button
- Using the keyboard, tab to your button and then open it, try to navigate using arrows
- Only the 2 buttons explicitly listed in the template will navigate, the button from the component will not allow keyboard navigation. The manuData is missing for that element.
Expected Behavior
What behavior were you expecting to see? This was working before we upgraded to version 9. I have created 2 stackblitzes with the same example. @angular 7 works, @angular 8 and 9 do not.
Actual Behavior
What behavior did you actually see? The items that are listed as direct children are properly navigated to using arrow keys. The ones rendered from custom component are skipped.
Environment
- Angular: 9.0.2
- CDK/Material: 8.2.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@kbondsj
Angular: 9.0.2
In your stackblitz, most of angular is at 9.0.0-rc.1
CDK/Material: 8.2.3
Since there is a big bunch of changes for Angular 9, i dont think its a good idea to use Material 8 with angular 9.
Yes, it's worth mentioning that I found the issue in @angular8 as well. I upgraded the stack to 9 to see if got fixed but it hadn't. I can revert the stack if it suits you. Issue was found on @angular8.2.14
I just updated https://stackblitz.com/edit/angular-9-mat-menu to use 8.2.14 so you can see the issue still exists.
I also ran into this issue, and determined that this functionality broke starting in Material version 8.1.0.
Closing this as a duplicate of https://github.com/angular/components/issues/18617. Thanks for this report!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.