0
votes

I have a PrimeNG dropdown with 1000s of values. So I put in a filter. Now the issue is I want to have a filter with something like "filterMatchMode = startwith" which we have for table filter columns. The default implementation is "contains" which cannot be overridden by the "filterMatchMode" property like we have in tables. Issue with this is that I have multiple values ending in "xyz" and I have a value which is "xyz". So I have to scroll all the way down to select the value. What could be possible solutions?

Current Code which does not solve the problem:

 <p-dropdown [options]="myOptions" [(ngModel)]="selectedModel" filter="true" placeholder="Select a Model"
    [style]="{'width':'200px'}">
</p-dropdown>
1

1 Answers

0
votes

Only thing I can think of is to make a full copy of the primeNG dropdown component to change it. They use a filter method in an objectutils class to filter. This method is using indexOf to do the filtering, you could replace it with contains.