ionic-framework: bug: Ion-image inside virtual scroll shows wrong image until new one loaded
Bug Report
Ionic version:
[x] 4.x
Current behavior:
When adding ion-image inside virtual scroll and scrolling it is showing old image for some time until the new image is loaded.

Expected behavior:
Should not show wrong image, instead should be empty image until the image is loaded
Steps to reproduce:
Add virtual scroll and add image inside each item, then scroll trough to see wrong image displayed for short time.
Related code:
https://github.com/jgermanis/virtual-scroll-test
Other information:
Ionic info:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 15 (3 by maintainers)
Wanted to +1 this issue. I quickly tried @michael-roewin’s suggestion to use
<img>instead of<ion-img>but it didn’t seem to stop the image from the last DOM scroll staying in place until the new image is loaded.In my mind there are two ways to address this
It’s not acceptable for me personally to have the images flash to the new image on load.
I’m pretty sure I will have to abandon virtual scroll and do some type of pagination.
To Fix this permanently:
Use this: https://github.com/rintoj/ngx-virtual-scroller
Do this in page where there is ion-content:
Now, you can use importantElement right away or store it in the service in case you need it in routes where there is no ion-content.
Bob IS your uncle.