mdlivingston / mat-select-filter

mat-select-filter
MIT License
28 stars 30 forks source link

Doesn't work with multiple dropdown #14

Open abdulhamdan8 opened 3 years ago

abdulhamdan8 commented 3 years ago

this package doesn't filter properly with multi select dropdown

pratik-kadoli1998 commented 3 years ago

same error with me whenever i search particular name(value) and select then previous selected values automatically gets deselected and another is whenever i reopen filter typed value remains same..

VoidTallica commented 2 years ago

I solved this problem by combining the code from this two posts: https://stackblogger.com/angular-material-multi-select-all-with-large-dataset/ https://stackblitz.com/edit/mat-select-filter?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts Bassically you need the code from the last post and you just add the "mat-select-filter" part. There's a function called "ngAfterViewInit", where always makes sure the selected values are correct, even if you scroll or search another word on filter. Also using CdkVirtualScrollViewport, makes your dropdown way faster. It will loke something like this: image