Based on value of autocomplete selection, I need to update some other form fields.
So, I added optionSelected event handler:
<mat-autocomplete (optionSelected)="onOptionSelected($event)">
<mat-option *ngFor="let item of items"
[value]="item">
<span>{{item}}</span>
</mat-option>
</mat-autocomplete>
The user should be able to clear the selection, in which case I need to reset the other fields, too.
The problem is that optionSelected is not triggered when mat-autocomplete gets emptied by the user.
How do I catch the autocomplete was cleared event?