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

Prevent Infinite Scroll "Preload" Runaway #941

Open
Archmonger opened this issue Apr 28, 2021 · 0 comments
Open

Prevent Infinite Scroll "Preload" Runaway #941

Archmonger opened this issue Apr 28, 2021 · 0 comments

Comments

@Archmonger
Copy link

Archmonger commented Apr 28, 2021

Description
When preloading, it is currently possible to get stuck in an infinite loop of preload. InfiniteScroll will either need to be able to detect this situations and wait it out, or have a maxPreload value.

Reproduce
In order to set up the situation, put a InfiniteScroll'd masonry into an iFrame. But prior to the iFrame loading, make the iFrame have a display: none; attribute. When in this situation, the height of any "infinite-scrollers" on the page are presumably forced to 0 due to display: none, so preload will preload forever.

Can be reproduced by putting Conreq into an Organizr iframe tab, then immediately clicking on a different tab before Conreq loads.

Struggled to create a codepen for this.

Potential Resolutions

  1. Have a maxPreload value where the user can enforce a maximum amount of pages that are allowed to be preloaded.
  2. If infinite scroll container height stays 0 across the first two preloads, then InfiniteScroll should resort to polling the container and waiting for its height to become a real value.
  3. Detect if the user is in an iFrame and/or if the browser window does not have focus. Do not preload until focus is obtained.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant