navigator: also track comments visible in viewport (#2482)
This commit is contained in:
parent
5f697f3434
commit
a794b59b91
@ -62,10 +62,6 @@ export function useCommentsNavigator () {
|
||||
window.requestAnimationFrame(() => {
|
||||
if (!commentRef?.current || !commentRef.current.isConnected) return
|
||||
|
||||
// don't track this new comment if it's visible in the viewport
|
||||
const rect = commentRef.current.getBoundingClientRect()
|
||||
if (rect.top >= 0 && rect.bottom <= window.innerHeight) return
|
||||
|
||||
// dedupe
|
||||
const existing = commentRefs.current.some(item => item.ref.current === commentRef.current)
|
||||
if (existing) return
|
||||
|
Loading…
x
Reference in New Issue
Block a user