[ad_1]
I’m using angular 13, and I have a mat-select
that uses a ngx-mat-select-search
with a noEntriesFoundLabel
that is supposed to display a label when there are no options available for the mat-select.
My issue is that i’m using a <mat-option >-</mat-option>
with no value, that is supposed to serve as a “all” value.
<mat-form-field>
<mat-select [formControl]="bankCtrl" placeholder="Bank" #singleSelect>
<mat-option>
<ngx-mat-select-search [noEntriesFoundLabel]="'No options'" [formControl]="bankFilterCtrl"></ngx-mat-select-search>
</mat-option>
<mat-option >-</mat-option>
<mat-option *ngFor="let bank of filteredBanks | async" [value]="bank">
{{bank.name}}
</mat-option>
</mat-select>
</mat-form-field>
Because of this, when there is not matching option with the user’s input, the no-match-label is not displayed because there is still this “-” option available.
Basically what I need is a kind of “offset” so that the noEntriesFoundLabel is displayed when there is only one match (my default “-“)
I didn’t find such a feature.
Do you have any kind of workaround I could use?
[ad_2]