I have an angular page. In a mat-form-field, I've created a datepicker the gets the year and month only so I made a onMonthSelect function.
picker.component.html
<input
matInput
[matdatePicker]="picker"
>
<mat-datepicker #picker (monthSelected)="onMonthSelect($envent, picker)">
</mat-datepicker>*
picker.component.ts
onMonthSelect(date: Moment, datepicker){<br>
datepicker.close();*
Here I want to put the focus back to matInput
}
After calling the datepicker.close(), the focus or cursor goes somewhere on top of the page instead on the next input field. When I press tab after the datepicker closes, it focus at top not the next <div> or component. I want to force the focus to go back to matInput or matPicker. I tried tabindex, but not working.