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

Detached DOM images get loaded when they shouldn't #229

Open
grololo06 opened this issue May 17, 2020 · 1 comment
Open

Detached DOM images get loaded when they shouldn't #229

grololo06 opened this issue May 17, 2020 · 1 comment
Assignees

Comments

@grololo06
Copy link

Hi,
We (https://github.com/oceanomics/ecotaxa_dev) reload part of a page using JQuery elem.html() with the output of an Ajax call. This part of the page contains up to 1000 images, so of course we use Lazy to load them only when needed.
We saw that, after reload, the (then detached) old DOM continued to trigger image loads from server.
The main cause being that _isInLoadableArea() always returns true for detached elements (getBoundingClientRect() returns 0 for all properties).
We chose to cure the problem by issuing proper .destroy() calls before DOM patching but I leave this issue here for the records, in case it helps someone.

@dkern dkern self-assigned this May 19, 2020
@dkern
Copy link
Owner

dkern commented May 19, 2020

Bit of an edge case but intresting. Maybe an additional check could solve this issue, but i'm not sure if i want to add those overhead to all instances ...

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

2 participants