Add virtual scrolling for search value selector

Adds virtual scrolling for the search value selector.
This commit is contained in:
Sean 2020-09-08 12:57:27 +02:00
parent 5b63809b12
commit eb98289b84
2 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,9 @@
</mat-option> </mat-option>
<mat-divider></mat-divider> <mat-divider></mat-divider>
</ng-container> </ng-container>
<mat-option *ngFor="let selectedItem of getFilteredItems()" [value]="selectedItem.id"> <cdk-virtual-scroll-viewport class="vscroll-viewport" minBufferPx="200" maxBufferPx="300" [itemSize]="50">
{{ selectedItem.getTitle() | translate }} <mat-option *cdkVirtualFor="let selectedItem of getFilteredItems()" [value]="selectedItem.id">
</mat-option> {{ selectedItem.getTitle() | translate }}
</mat-option>
</cdk-virtual-scroll-viewport>
</mat-select> </mat-select>

View File

@ -28,3 +28,8 @@
display: block; display: block;
text-align: left; text-align: left;
} }
.vscroll-viewport {
height: 200px;
display: block;
}