GoogleChromeLabs/quicklink

Consider adding `rootMargin` to the Intersection Observer

Open

#14 ouverte le 10 déc. 2018

Voir sur GitHub
 (13 commentaires) (1 réaction) (0 assignés)JavaScript (431 forks)batch import
enhancementgood first issuehelp wanted

Métriques du dépôt

Stars
 (10 861 stars)
Métriques de merge PR
 (Merge moyen 47j 12h) (4 PRs mergées en 30 j)

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

Guide contributeur