paveisistemas / ionic-image-lazy-load

Directive to Ionic Framework that only loads an image when it is seen by the user.
http://codepen.io/pavei/pen/oFpCy
MIT License
366 stars 117 forks source link

Lazy load getting confused with collection-repeat images #24

Closed CookieCookson closed 4 years ago

CookieCookson commented 9 years ago

If you wish to use the new collection-repeat built by Ionic to save performance on lists, it does not work well with images when used with this lazy load directive. Essentially it gets images confused on long lists and also doesn't update the src when using search filtering etc, so you often get the incorrect image matching up with titles etc. Unfortunately I do not have an example project to show off for this but am happy to put one together to demonstrate the issue I am having.

Cheers

Christian

martinjbaker commented 9 years ago

I have the same issue. Sadly it seems this isn't compatible with collection-repeat because it doesn't force a re-load of the new images when existing rows are reused.

martinjbaker commented 9 years ago

The fork by @cantecim gets part of the way there - it does reload the image when cell is reused - but I'd like to reset the background image to my default when the row becomes available for reuse.

cantecim commented 9 years ago

@martinjbaker I was planning to use it for my private cases because i didn't implemented complete reload feature when i see this comment i changed my mind. i send a pr with the current state

martinjbaker commented 9 years ago

No worries. I'm now using a different technique with my "loading" default background image set on the top level list row div, and a child div that contains the actual background image for each row. This works perfectly with collection repeat, so I don't need this directive any more.