I am using the standard Angular2 Material Menu structure to create a top bar menu items that open sub-menus, like the code below from my project:
<button mat-button matTooltip="Events..." matTooltipPosition="below" [mat-menu-trigger-for]="eventsMenu">
<span hide-xs hide-gt-xs show-gt-sm>EVENTS</span>
<mat-icon>event</mat-icon>
</button>
<mat-menu xPosition="after" yPosition="below" #eventsMenu="matMenu" [overlapTrigger]="false">
<button mat-menu-item>
<mat-icon>menu</mat-icon>
<span>Agenda</span>
</button>
<button mat-menu-item>
<mat-icon>menu</mat-icon>
<span>Find Events</span>
</button>
...
What bothers me about these sub-menus is that:
- They don't open on mouse hover;
- They don't close when I click in other main-menu item (I have to click outside the sub-menu container, it hides, then I can click the other menu item);
- The main menu clicked item gets focused background even after the sub-menu hides (I think it's because I used the
<button>
tag).
I am new to Angular, just my second project using Angular Material. Can anyone tell me how can I sold these situations?
Forgot to mention: I am using Teradata Covalent template, if that changes anything...