GoogleChromeLabs / GoogleChromeLabs/quicklink

Consider adding `rootMargin` to the Intersection Observer

Open
#14 13 comments 1 reaction 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
JavaScript
Stars
11.3k
Forks
429
PR merge metrics
No merged PRs in 30d

Description

Feedback from @surma:

> I feel like by default you should add a rootMargin to the IO to trigger the load before something comes into the viewport.

So, `rootMargin` defaults to "0px 0px 0px 0px", meaning the intersection will be computed between the root element's unmodified bounds rectangle and the target's bounds. This change would be made to https://github.com/GoogleChromeLabs/quicklink/blob/master/src/index.mjs#L21

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.