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

dynamic lozad does not load data-src #245

Open
gabrielsze opened this issue Aug 8, 2020 · 0 comments
Open

dynamic lozad does not load data-src #245

gabrielsze opened this issue Aug 8, 2020 · 0 comments

Comments

@gabrielsze
Copy link

gabrielsze commented Aug 8, 2020

Referring to similar issues raised
#50
#156

  • Forcing data-loaded to "false" doesn't seem to help...

Expected Behavior

I followed the documentation to call observer.observer() on adding dynamic components. This only happens when I navigate across pages (and yes, dynamically generating them). Reloading the page works fine.

Current Behavior

The current/previous images loads normally, but the newly added components does not load. The new components has src as the placeholder (haven't been converted to data-src) and data-loaded is missing from the element.

Edit:
data-loaded is missing when inspecting page, but on console log element with document.getElementById seems to show data-loaded is present.

Possible Solution

Was playing around and found a temporary and unstable fix which worked if i did this:
(Doesn't work half the time)

setTimeout(() => {
          observer.observe();
        }, 2000);

Context

I'm working with lozad on VueJs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant