Virtual Scroll + Segments or Search


#1

Hi,

I noticed that when I add VirtualScroll to two lists which are in different segments, it breaks as soon as I change segment. Here is the code:


<div [ngSwitch]="profile">

    <ion-list [virtualScroll]="pItems" *ngSwitchCase="'profile_1'">
        <button ion-item *virtualItem="let pItem" (click)="goToP(pItem)">{{pItem.company}}</button>
    </ion-list>
		
    <ion-list [virtualScroll]="mItems" *ngSwitchCase="'profile_2'">
        <button ion-item *virtualItem="let mItem" (click)="goToN(mItem)">{{mItem.company}}</button>
    </ion-list>

</div>

It’s a shame because I have noticed significant performance improvements in non-segmented tests.

In addition to this, the searchbar disappears completely.

Previous code for a segment with search (works well):

<ion-list *ngSwitchCase="'profile_1'">
    <ion-searchbar (ionInput)="filterP($event)" placeholder="Search"></ion-searchbar>
    <button ion-item *ngFor="let pItem of pItems; let i=index" (click)="goToP(pItem)">{{pItem.company}}</button>
</ion-list>

Attempt to use search with VirtualScroll and without segments:

<ion-list [virtualScroll]="pItems">
    <ion-searchbar (ionInput)="filterP($event)" placeholder="Search"></ion-searchbar>
    <button ion-item *virtualItem="let pItem" (click)="goToP(pItem)">{{pItem.raison_sociale}}</button>
</ion-list>

Would anyone have any ideas?