GoogleChromeLabs/quicklink

Consider adding `rootMargin` to the Intersection Observer

Open

#14 geöffnet am 10. Dez. 2018

Auf GitHub ansehen
 (13 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (431 Forks)batch import
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (10.861 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 47T 12h) (4 gemergte PRs in 30 T)

Beschreibung

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