ng-lazy-image icon indicating copy to clipboard operation
ng-lazy-image copied to clipboard

Images not loaded when scrolling fast

Open maelfrize opened this issue 9 years ago • 10 comments

First of all thanks for your great library.

I noticed that the images are not loaded when scrolling down fast and stopping abruptly. I have to scroll a little bit more again and only than the images are loaded.

Can you reproduce this behaviour? Any idea on how to fix this?

maelfrize avatar Mar 19 '16 20:03 maelfrize

I've noticed this as well. Can reproduce it consistently but I'm not quite sure what the cause is.

dmigliorisi avatar Apr 04 '16 14:04 dmigliorisi

This seems to be caused by the debounce (added in https://github.com/afklm/ng-lazy-image/commit/a5f82f9850ab6ad1cc5ec0661647f0d060177cb8)

var _onViewChangeDebounced = srcSetService.debounce(_onViewChange, 300);

When not using the debounce function, I no longer see this issue

var _onViewChangeDebounced = _onViewChange;

horst80 avatar Apr 05 '16 07:04 horst80

@horst80 That worked for me as well. I don't really want to be messing with this code in my project. Hoping we can get an update that fixes this.

dmigliorisi avatar Apr 07 '16 13:04 dmigliorisi

@dmigliorisi , you could use version 0.2.3, the issues does not exist there.

horst80 avatar Apr 07 '16 21:04 horst80

@horst80 you're right about that lower version and its change. But there is another issue if you use version 0.2.3. Because if we don't use debounce/throttle, it causes performance issue. I think it will be better than current version when #65 is merged.

barinali avatar Nov 08 '16 17:11 barinali

@horst80, @dmigliorisi we've merged #65. I think your issue would be fixed. If you can test your code with current version and verify this, we can close this issue.

Thanks,

barinali avatar Nov 15 '16 11:11 barinali

Hi @barinali , the scrolling still seems buggy to me, looking at this example:

http://afklm.github.io/ng-lazy-image/sample-repeat.html

When quickly scrolling down to the bottom, the images are not being loaded. They do become visible once you scroll up again a little bit. Are you able to reproduce this?

horst80 avatar Nov 16 '16 03:11 horst80

We're having this issue as well. Any update?

RustyDev avatar Jan 13 '17 01:01 RustyDev

Do you set the container height with the css trick (Option to use aspect ratio's)? So even when image not being loaded at first the position is in the right place of the screen when it eventually calculates the position (on scroll stop)?

SquadraCorse avatar Jan 13 '17 13:01 SquadraCorse

I replaced throttle function with better one and just works in #68

burakkirkil avatar Feb 06 '17 13:02 burakkirkil