ngx-virtual-scroller icon indicating copy to clipboard operation
ngx-virtual-scroller copied to clipboard

virtual scroll getting stuck

Open luqmaants opened this issue 5 years ago • 2 comments

I have implemented a virtual scroll. The data in the virtual scroll is refreshed every-time, and then I scroll to the top of the virtual scroll.

<li class="inLine"  *ngFor="let item of scroll.viewPortItems; let i=index" (click)="getDetails(item)">
     <ion-card style="width: 100px;
                    border-radius: 5px;
                    border: 0.55px solid #c8c7cc; box-shadow: none !important">
                 <ion-avatar style="width: 100px; height: 100px;">
                    <!--<img [src]="item.photoUrl" onError="this.src='assetssets/images/default.jpg'" class="circularImage">-->
                    <img-loader class="proImage" [src]="item.photoUrl" fallbackUrl="assets/images/recent_default.png" 
                                spinner="false" fallbackAsPlaceholder="true"></img-loader>
                  </ion-avatar><ion-item style="border-bottom: 0.55px solid #c8c7cc; padding-left: 5px !important;" *ngIf="sortBy == 'firstname'">
                    <p style="font-weight: 500; color: #333">{{ item.firstname }}</p>
                    <p style="font-weight: 500; color: #333">{{ item.lastname }}</p>
                  </ion-item><ion-item style="border-bottom: 0.55px solid #c8c7cc; padding-left: 5px !important;" *ngIf="sortBy == 'lastname'">
                    <p style="font-weight: 500; color: #333">{{ item.lastname }}</p>
                    <p style="font-weight: 500; color: #333">{{ item.firstname }}</p>
                  </ion-item>
            </ion-card>
    </li>  
</virtual-scroller>

But if the virtual scroll is already on the top, it gets stuck, and does scroll or move anymore. When I switch tabs or perform a hard-coded based- scrollTO method to scroll a little and then come back to the top, it works fine. Did anyone else experience something similar?

luqmaants avatar Jul 08 '19 16:07 luqmaants

@luqmaants I'm seeing something similar. Here is what i'm seeing.

On a list that I have virtual scrolled I scroll down a little bit so that the start index is no longer 0. If I then quickly scroll back up and then try to scroll back down the scroll behavior is now stuck. The list will not scroll up or down until I pause for a second and/or move the mouse then continue scrolling. I can also reproduce this on the sample page https://rintoj.github.io/ngx-virtual-scroller/samples

At least scrolling starts to work again after pausing for a second, but it is pretty annoying. I hope this can be fixed.

EDIT: for me this is happening in Chrome: 78.0.3904.108 It doesn't seem to happen in older versions of chrome or in firefox/safari. So maybe it's not an issue with this library.

tdecker91 avatar Nov 27 '19 17:11 tdecker91

Issue still persists, any updates?

szmuk avatar Jun 16 '22 13:06 szmuk