2
votes

I am using mat-menu to display a form and need to change focus between inputs on the tab keypress event. But when I press tab, the mat-menu closes.

Example:

https://stackblitz.com/edit/angular-u5qbkt?file=src%2Fapp%2Fapp.module.ts

1

1 Answers

3
votes

In form tag write this line (keydown.tab)="$event.stopPropagation()"

like this->

 <form (keydown.tab)="$event.stopPropagation()" [formGroup]="form" (ngSubmit)="submit()" (click)="stop($event)" class="formValueGenerator" autocomplete="off">