Skip to content

feat: support IntersectionObserver v2 trackVisibility/delay options - #144

Open
metonym wants to merge 1 commit into
masterfrom
metonym/support-trackvisibility-delay
Open

feat: support IntersectionObserver v2 trackVisibility/delay options#144
metonym wants to merge 1 commit into
masterfrom
metonym/support-trackvisibility-delay

Conversation

@metonym

@metonym metonym commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds trackVisibility/delay options across all three surfaces (IntersectionObserver, MultipleIntersectionObserver, intersect/intersectAttachment), enabling occlusion-aware visibility via entry.isVisible (Intersection Observer v2)
  • Needed for trustworthy ad/analytics impression tracking, one of this library's stated use cases — without it, an element can report as intersecting even when fully covered by another element
  • Augments TypeScript's DOM lib (which doesn't yet declare IO v2) so trackVisibility/delay/entry.isVisible type-check cleanly

Test plan

  • bun test:types passes
  • bun test:e2e passes (27/27), including a new fixture that verifies entry.isVisible is false while the element is occluded and true once unoccluded (skipped on non-Chromium browsers, since IO v2 is Chromium-only)

Adds occlusion-aware visibility tracking across the component, multiple-
element component, action, and attachment surfaces — needed for
trustworthy ad/analytics impression tracking, one of this library's
stated use cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant