Add virtual scrolling for search value selector
Adds virtual scrolling for the search value selector.
This commit is contained in:
parent
5b63809b12
commit
eb98289b84
@ -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>
|
||||
|
@ -28,3 +28,8 @@
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.vscroll-viewport {
|
||||
height: 200px;
|
||||
display: block;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user