Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualScroll flashes "wrong" items and in inverse order on init/reinit #12047

Closed
petermm opened this issue Jun 15, 2017 · 6 comments
Closed

Comments

@petermm
Copy link

petermm commented Jun 15, 2017

Ionic version: (check one with "x")
[ X] 3.x

I'm submitting a ... (check one with "x")
[X ] bug report

Current behavior:
A virtualScroll list will flash "wrong" items (and in inverse order) - before showing correctly.
This is especially obvious on (slower) devices (iphone 5s - not really slow but..)

Expected behavior:
The virtualScroll list is not shown until it is in correct order/state, it should not flash "wrong" items, nor in inverse order.

Steps to reproduce:
The plunker is fully up to date. - click the button to empty and refill the list("reinit" the virtualScroll).
the [hidden] does not effect the behaviour nor does the console.log in virtualTrackBy.

use chrome dev tools -> performance -> to throttle cpu 10x-20x and see that the flash is in inverse order.
http://plnkr.co/edit/VyvZo6iJgYK6exyrPcAe?p=preview

Other information:
This is a blocking bug for using virtualScroll.

Also notice that the virtualTrackBy is called 3 separate times (times items.length), might not be optimal.

12047

@jgw96
Copy link
Contributor

jgw96 commented Jun 15, 2017

Thanks for using Ionic, we will look into this.

@petermm
Copy link
Author

petermm commented Jun 16, 2017

fwiw, I was able to use https://github.com/rintoj/angular2-virtual-scroll - add to app module and then do the following, appears to work great, and as expected..

<ion-content no-bounce>
  <virtual-scroll
    [hidden]="items.length"
    [items]="items"
    (update)="scrollItems = $event"
    style="height: 100%; display: block"  ion-fixed>
    <div *ngFor="let item of scrollItems;trackBy: item?.id;let i = index" style="width: 100%">
      <ion-item style="width: 100%" (click)="clickItem(item, i)" >
        {{item.id}}
      </ion-item>
    </div>
  </virtual-scroll>
</ion-content>

@trebor678
Copy link

+1

@trebor678
Copy link

@petermm I tried using angular2-virtual-scroll but couldn't get it to work with Ionic. It seems like the list that it sends from the update function doesn't contain any items. Which version are you using?

@JustasKuizinas
Copy link

+1

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 28, 2018

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Jun 28, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants