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-divider></mat-divider>
</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">
<mat-option *cdkVirtualFor="let selectedItem of getFilteredItems()" [value]="selectedItem.id">
{{ selectedItem.getTitle() | translate }}
</mat-option>
</cdk-virtual-scroll-viewport>
</mat-select>

View File

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