-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: view port observer on lost visibility #17417
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #17417 +/- ##
==========================================
- Coverage 46.15% 46.14% -0.01%
==========================================
Files 753 753
Lines 24732 24737 +5
Branches 5671 5672 +1
==========================================
+ Hits 11414 11416 +2
- Misses 11886 11887 +1
- Partials 1432 1434 +2 |
if (!onVisibilityLost) { | ||
releaseTrackers(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to release the trackers after detecting element's visibility (we want to detect its visibility lost later).
Element, | ||
{ | ||
allowBiggerThanViewport?: boolean; | ||
requireFullyInView?: boolean; | ||
onVisible?: Function; | ||
onVisibilityChange?: (isVisible: boolean, isPartiallyVisible: boolean) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added types here and renamed onChange
to onVisibilityChange
for more clarity.
Quality Gate passedIssues Measures |
Description
Adds an ability to subscribe to visibility loss after the changing the visibility from "visible", to "not visible at all" (not intersecting at all).
Checklist