Skip to content
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

Analytics: Do not report visibility when element size is 0 #29946

Closed
zhouyx opened this issue Aug 24, 2020 · 0 comments · Fixed by #30105
Closed

Analytics: Do not report visibility when element size is 0 #29946

zhouyx opened this issue Aug 24, 2020 · 0 comments · Fixed by #30105

Comments

@zhouyx
Copy link
Contributor

zhouyx commented Aug 24, 2020

From #29820

Analytics visibility tracking is using the IntersectionObserver internally to fire visible events.
The InOb fires and set intersectionRatio at 1 even when the element size is 0. This leads to element's visibility requests being sent even when it is not actually visible.

The fix is to check element's size before calculating its visibility state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant