Merge pull request #5550 from tsiegleauq/vscroll-selector-component

Add virtual scrolling for search value selector
This commit is contained in:
Emanuel Schütze 2020-09-17 16:48:12 +02:00 committed by GitHub
commit e8e39b1e89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}