Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Calling load() on a lazy loaded element doesn't work #67

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

Closed
latentflip opened this issue Jul 29, 2021 · 1 comment · Fixed by #66
Closed

Calling load() on a lazy loaded element doesn't work #67

latentflip opened this issue Jul 29, 2021 · 1 comment · Fixed by #66

Comments

@latentflip
Copy link

I've discovered a bug where calling load() manually on a lazy loaded breaks the element. It triggers the request, but then when the element becomes visible the content isn't replaced. Example below from the examples page:

bug.mov
@latentflip
Copy link
Author

There appear to be two separate bugs at play here:

  1. The load() function un-observes the intersection observer, which means when the element becomes visible it will not trigger content replacement:
    observer.unobserve(this)
  2. Removing that line will fix the bug, but the preloading doesn't actually work, a second request for the content will be made when the element becomes visible. That's because the load() function doesn't actually store the result anywhere.

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

Successfully merging a pull request may close this issue.

1 participant