Open jsBiztech opened 5 years ago
I was having the same issue. I found that using <li>
works best, instead of using div or <ion-item>
.
Thanks for the reply @luqmaants .Did you used <li>
inside <virtual-scroll>
.
Also I am facing this issue in iOS only, Do you think this will resolve the issue?
Same issue here. @luqmaants and @nagdevbharat did this help you? It doesn't seem to make a difference for me.
@lincolnthree , the issue still persists. Have you found any solution for this?
Negative. No ideas here. I'm not very practiced with animations/etc. I try to avoid that level of UI unless absolutely necessary. I tried replacing with ion-virtual-scroll, but that component has even more issues. Just suffering through the jitter at the moment.
I was having the same issue, solved it by installing WKWebView. ionic cordova plugin add cordova-plugin-ionic-webview --save
@ambu50 , I have webview installed: ionic-native/ionic-webview: ^5.6.1
and the issue still persists
@nagdevbharat @lincolnthree I Just implemented a solution for my use case, here's what it looks like:
` <virtual-scroller #scroll [items]="arrayOfItems"" [executeRefreshOutsideAngularZone]="executeRefreshOutsideAngular" (vsStart)="vsStartUpdate($event)">
</virtual-scroller>`
And in the typescript file:
`public executeRefreshOutsideAngular: boolean = false;
public vsStartUpdate(event: IPageInfo) { if(!this.arrayOfItems) return; this.toggleChangeDetectionOfVirtualScroller(event); }
private toggleChangeDetectionOfVirtualScroller(event: IPageInfo){ if(event.endIndex >= this.arrayOfItems.length-1){ // we are at the bottom of the list // executeRefreshOutsideAngularZone IF the user is not scrolling up // if (event.scrollStartPosition <= event.scrollEndPosition) // means we are scrolling upwards, and wa want to set the boolean to false, otherwise true // this.executeRefreshOutsideAngular = event.scrollStartPosition <= event.scrollEndPosition; } else { this.executeRefreshOutsideAngular = false; this.forceDetectChanges(); } }
public forceDetectChanges() { this.changeDetectorRef.detectChanges(); }`
Basically I check if the last item in the viewport is the last item in the list of items. If it is, and if the user is not scrolling back up, i set executeRefreshOutsideAngularZone to true, otherwise false. when setting the executeRefreshOutsideAngularZone back to false, I also force change detection because otherwise it was being a bit buggy
Hi @IfreannMedia , Sorry for the late reply. I tried the code and it doesn't seem to be working in my project. Can you please provide more details on what happens when change detection is called? Thanks
I tried the solution of @IfreannMedia, too. Unfortunately, this didn't solve the issue for me. It looks as if it makes it even worse 😕
Can confirm this. Happens in any browser in IOS
I am using this virtual scroll to display data with lazy loading in Ionic 3. It is working fine with browser and android app but in iOS sometimes the scrolling becomes jittery because of some reasons, which I was unable to find. Here are the details:
Template Structure: