GoogleChromeLabs/quicklink

Consider adding `rootMargin` to the Intersection Observer

开放

#14 创建于 2018年12月10日

 (13 条评论) (1 个反应) (0 位负责人)JavaScript (426 个派生)batch import
enhancementgood first issuehelp wanted

仓库指标

星标
 (11,269 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南