I have a <mat-select> element and I want to execute a function on blur of the element.
currently the function executes on selection change:
<mat-form-field fxFlex>
<mat-label>SSR Status</mat-label>
<mat-select [formControl]="ssrStatuses" multiple (selectionChange)="filtersUpdated()" [(value)]="selectedSsrStatuses">
<mat-option *ngFor="let ssrStatus of ssrStatusList" [value]="ssrStatus.id">{{ssrStatus.label}}</mat-option>
</mat-select>
</mat-form-field>
I can't see any mention of blur or focus in the angular material mat-select docs. These docs on angular 4 mention (blur)="myMethod()" but that doesn't work on my <mat-select>. How do I execute a function on blur of <mat-select>?
If it is still actual, try to use closed event:
<mat-select (closed)="someMethod()">
<mat-option></mat-option>
</mat-select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With