-
Notifications
You must be signed in to change notification settings - Fork 37
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
deferLoad not working in Child Components #20
Comments
Yes, i second this. Trieed in app.component: works. Tried in some child component: doesnt work. Any idea why? |
Ok, I'm gone deeper and found out: Object.keys(entry).length in line 80 is 0 so the fallback (check page and element offset isVisible()) is taken to check, whether to load the image or not. But entry is an IntersectionObserverEntry with keys and values inside. Now, all offsets of images where smaller than scrollY + clientHeight, cause they where not loaded and didnt take any space. If I give them space it works. But upper problem still exists. |
@BasilioB thank you for checking on that. i'm going to check this out again and see if I can find anything else as well. |
Any update on this? |
this component is more like un useful if it does not support child components |
Any update on this? |
Having the same issue |
Hi, I wanted so dig into it so I set it up as a directive in my project ... and now it's working (just created the directive with "ng generate directive" and copy pasted the code + added the module. I don't have time to look at it now (works, don't care :P ) but might look into it sooner or later. Can't explain why but maybe it helps someone. |
@thesignal Awesome! If there's any changes you made when you have time it'd be really sweet to get a PR. |
I did not try with the app.module, but I followed the example link pretty closely and this is the only difference I could find.
When deferLoad is used in a child component, it will load all images that are presently in the initial viewport but fail to load any images on new images that come to the viewport thereafter.
The text was updated successfully, but these errors were encountered: