Virtual scroll not working in ionic 4

I’ve inherited an ionic 4 project, which needs some changes to make it work faster - currently it’s very slow.

i’m trying to implement virtual scroll on a list of users - the list is generated to show who’s around you based on your location. No matter where i put it, it doesn’t work, and in most cases breaks the page - can it even be implemented in this instance. I’m still pretty new to javascript and ionic so apologies if it’s an obvious question.

code snippet below, thanks.

            <ion-list class="avatar-list"> 
 
                <div class="usercontainer">

                    <ion-item lines="full" *ngFor="let np of nearbyPeople" no-lines tappable (click)="viewUser(np.id)">

                            <ion-avatar slot="start">
                                <img src="{{np.img}}">
                            </ion-avatar>
                            <ion-label>
                                <h2>{{np.name}}</h2>
                                <p>@{{np.username}} <span class="verifyflagico-small" *ngIf="np.verifyflag"></span></p>
                            </ion-label>

                            <ion-button class="purple" slot ="end" fill="clear" *ngIf="np.status == 1" tappable (click)="message(np.id); $event.stopPropagation();">
                                <ion-icon class="icon" name="ios-chatboxes"></ion-icon>
                            </ion-button>
                            <ion-button slot="end" fill="clear" *ngIf="np.status != 1" tappable (click)="viewUser(np.id); $event.stopPropagation();">
                                <ion-icon class="icon" name="arrow-forward"></ion-icon>
                            </ion-button>
    
                    </ion-item>

                </div>
            </ion-list>
1 Like

Am also facing the same problem.I hope someone answer this soon!

a scroll function stops working when you put the “click” function or others in the element … removing the click function, it will work, but this is terrible, I didn’t find a solution …