Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
User clicks on the mat-menu trigger button, and first item within menu (or the entire menu) is focused.
What is the current behavior?
User clicks on the mat-menu trigger button, the button stays focused. This creates couple of accessibility issues. Note that if its triggered via keyboard this issue doesn't repro thanks to this logic: https://github.com/angular/material2/blob/3728555c6e37dbeb1756366c797c99655d8ffa1f/src/lib/menu/menu-trigger.ts#L240
What are the steps to reproduce?
- Go to https://stackblitz.com/angular/lrpbkepagev?file=app%2Fmenu-overview-example.html
- Click on the menu button
- Note that focus stays on the button (print document.activeElement)
Note that if you do this via keyboard, the first focusable element within mat-menu is focused.
What is the use-case or motivation for changing an existing behavior?
We have a tooltip component that stays open when a button is focused. When there is a tooltip and a menu attached to a component, click on the menu trigger button will result in both tooltip and menu showing. Once user clicks on menu, the menu component should take away to focus (like it does when its triggered via keyboard). This would also make sure screen readers announce the right content.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All