Skip to content

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

Merged
thet merged 1 commit into
masterfrom
inject-autoload-visible-checkviewport
Dec 22, 2021
Merged

pat-inject autoload visible: check if element is in viewport to not load elements outside of it.#942
thet merged 1 commit into
masterfrom
inject-autoload-visible-checkviewport

Conversation

@thet

@thetthet commented Dec 22, 2021

Copy link
Copy Markdown
Member

Attempt to fix#939
Alternative approach: #941

@gystgyst left a comment

Copy link
Copy Markdown
Contributor

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
thetforce-pushed the inject-autoload-visible-checkviewport branch from 2602c5f to 756182bCompareDecember 22, 2021 15:44
@thet
thet merged commit 49863b7 into masterDec 22, 2021
@thet
thet deleted the inject-autoload-visible-checkviewport branch December 22, 2021 15:47
Sign up for freeto 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

@thet@gyst