Skip to content

pat-inject autoload visible: check if element is in viewport to not load elements outside of it. #942

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

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

thet
Copy link
Member

@thet thet commented Dec 22, 2021

Attempt to fix #939
Alternative approach: #941

Copy link
Contributor

@gyst gyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this change with Cornelis and he told me the "pre-loading" of items just before they will become visible, is not handled in javascript but in markup.

From my perspective this is a valid and minimal solution to #939. I propose to merge this and not do the more invasive refactorings of the other PRs, at least not now.

@gyst gyst marked this pull request as ready for review December 22, 2021 12:52
Fix autload-visible trigger to only load the injection if the element is in the viewport.
As before, this check is done after 100ms.
This prevents loading items when we quickly scoll across them, like with href-section-jumps.
@thet thet force-pushed the inject-autoload-visible-checkviewport branch from 2602c5f to 756182b Compare December 22, 2021 15:44
@thet thet merged commit 49863b7 into master Dec 22, 2021
@thet thet deleted the inject-autoload-visible-checkviewport branch December 22, 2021 15:47
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 this pull request may close these issues.

autoload-visible should not trigger injection for page elements above visible page top
2 participants