When <mat-menu>
is used on <mat-form-field>
it takes the focus from the input. I want the user to be able to use the input while the menu is opened.
Is this possible?
<mat-form-field appearance="outline" [matMenuTriggerFor]="appMenu">
<mat-label>Label color</mat-label>
<div class="color-container">
<div class="color-dot" [style.backgroundColor]="label.color"></div>
</div>
<input #input matInput class="pl-2" [(ngModel)]="label.color">
</mat-form-field>
<mat-menu #appMenu="matMenu" yPosition="below" [overlapTrigger]="false">
<mat-grid-list cols="8" rowHeight="30px">
<mat-grid-tile *ngFor="let color of colors">
<div mat-menu-item class="menu-item">
<div class="color-dot" [style.backgroundColor]="color"
(click)="label.color = color"></div>
</div>
</mat-grid-tile>
</mat-grid-list>
</mat-menu>