-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] When used with cdk-virtual-scroll-viewport it doesn't display the value #304
Comments
Thanks for reporting. it would be great if you could setup a quick demo on stackblitz for further investigation |
Thanks for replying, sorry for writing so late... I made a stackblitz: If you search for Bank Q and select it, you'll see that the field remains empty afterwards... It would be nice if you can help me spot the issue, because I have some big lists I want to display and I can't use the cdkVirtualFor because of this... and it's very slow with *ngFor... Many thanks in advance! |
I know it's too late, but hopefully it will help someone down the road. I fixed my issue by not filter on the '' value. this.filterSolString.valueChanges
added an open event on : <mat-select placeholder="" (openedChange)="openedDrawingIdChange($event)"> openedChange($event: boolean) { } |
Could you make a stackblitz so I can see the whole code? I didn't get exactly what you mean and I really need the fix. Many thanks! |
Has anyone any idea how to fix this StackBlitz? |
@macjohnny Is there a recommended way to support virtual/infinite scroll with ngx-mat-select-search? I see the stackblitz example in this repo is commented out, and based on this thread it seems that cdk-virtual-scroll isn't supported either. |
@jameskaye the infinitescroll example was commented out to be able to upgrade the angular version, but it should work. You can also help by creating an up-to-date example in this repo. if someone would like to propose a working example with virtual scroll id be happy to review it. |
Describe the bug
When used with cdk-virtual-scroll-viewport with a big list of items, it doesn't display the value in the input after selecting a searched item.
Check the bellow code:
<mat-select formControlName="solCompany" placeholder="Sol Company" #singleSelect1 (selectionChange)="getList()">
<ngx-mat-select-search [formControl]="filterSolString" [placeholderLabel]="'Search Company'">
<cdk-virtual-scroll-viewport [itemSize]="42" [style.height.px]=4*42>
<mat-option [value]="-1">Any
<mat-option *cdkVirtualFor="let company of utils.getObjectKeys(filteredSolCompany | async)" [value]="company">{{companies[company]}}
Expected behavior
Select the item and display it in the input field
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: