GoogleChromeLabs/quicklink

Consider adding `rootMargin` to the Intersection Observer

Open

#14 建立於 2018年12月10日

在 GitHub 查看
 (13 留言) (1 反應) (0 負責人)JavaScript (431 fork)batch import
enhancementgood first issuehelp wanted

倉庫指標

Star
 (10,861 star)
PR 合併指標
 (平均合併 47天 12小時) (30 天內合併 4 個 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

貢獻者指南