I have the following material menu:
<a mat-button [matMenuTriggerFor]="menu" disabled="true">Menu</a>
<mat-menu #menu="matMenu">
<button mat-menu-item>Item 1</button>
<button mat-menu-item>Item 2</button>
</mat-menu>
Notice that I have an <a>
tag instead of a <button>
.
I want to disable the mat menu trigger. If I use the button tag, it works, if I use it as an ancor tag, it still opens up the menu:
Any ideas how to prevent this with anchor
link tags?
Stackblitz example here.