I'm trying to block the close event which closes the calendar when selecting a date in angular material datepicker.
I've tried like,
// template
<mat-form-field>
<input matInput [matDatepicker]="picker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker (closed)="onCalendarClose(picker)"></mat-datepicker>
</mat-form-field>
// component
onCalendarClose(picker: MatDatepicker<Date>): void {
picker.open();
}
But this just literally reopens the calendar after closing it, which blinks the screen and shows back the calendar. So I'm wondering if I can block the close event upon selecting a date.
Update: I'm using Angular 8, Angular Material 8.1.4