Skip to content

Conversation

just-boris
Copy link
Member

Description

Fixing a bug where useIntersectionObserver only checks the first change entry instead of the latest.

Check the docs: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

The list of entries received by the callback includes one IntersectionObserverEntry object for each threshold-crossing event — multiple entries can be received at a time, either from multiple targets or from a single target crossing multiple thresholds in a short amount of time. The entries are dispatched using a queue, so they should be ordered by the time they were generated, but you should preferably use IntersectionObserverEntry.time to correctly order them.

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.01%. Comparing base (8d13105) to head (d5d6553).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3747    +/-   ##
========================================
  Coverage   97.01%   97.01%            
========================================
  Files         825      825            
  Lines       23946    23950     +4     
  Branches     8426     7997   -429     
========================================
+ Hits        23231    23235     +4     
- Misses        666      709    +43     
+ Partials       49        6    -43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@just-boris just-boris marked this pull request as ready for review August 11, 2025 22:05
@just-boris just-boris requested a review from a team as a code owner August 11, 2025 22:05
@just-boris just-boris requested review from pan-kot and removed request for a team August 11, 2025 22:05
@just-boris just-boris enabled auto-merge (squash) August 12, 2025 07:46
@just-boris just-boris merged commit 77f4711 into main Aug 12, 2025
38 checks passed
@just-boris just-boris deleted the use-resize-observer-multi branch August 12, 2025 10:18
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.

2 participants