Cdk virtual-scroll inside mat-select for mat-option

Discussão em 'Angular' iniciado por bhantol, Fevereiro 27, 2025.

  1. bhantol

    bhantol Guest

    Has anyone been able to use virtual-scroll inside mat-select as shown below ?

    <mat-form-field>
    <mat-select placeholder="State">
    <cdk-virtual-scroll-viewport autosize>
    <mat-option *cdkVirtualFor="let state of states" [value]="state">{{state}}</mat-option>
    </cdk-virtual-scroll-viewport>
    </mat-select>
    </mat-form-field>


    As you can see https://stackblitz.com/edit/angular-h4xptu?file=app/select-reset-example.html it does not work - causes weird blank space as you scroll.

    Continue reading...

Compartilhe esta Página