I need to react on option selection. My problem is that this component is not emitting event (selectionChange
output is not emitting new events) when I have selected option A, and I open select pane and select option A again. The event is not fired because selection is not changed but I need in my use case to fire an selection change event in this case. Does somebody know how to do this? Is there any way to override selectionModel
in this mat-select
component? I have a list of links and after selecting any of them I need to react even when user select the same link again. I'm using @angular/core@5.2.5
and @angular/material@5.2.1
.
Here is the template with this component that I want to use:
<mat-form-field>
<mat-select placeholder="Search history"
[disabled]="(links | async).length === 0"
[value]="(links | async).length > 0 ? (links | async)[0] : null"
(selectionChange)="onSearchHistorySelect($event.value)">
<mat-option *ngFor="let l of links | async" [value]="l">{{l.title}}</mat-option>
</mat-select>
</mat-form-field>