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

Remove the scroll listener to stop LCP observing #85

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

philipwalton
Copy link
Member

This PR fixes #75 by removing the scroll and pointerdown listeners and only relying on click and keydown listeners.

The implication of this change is that in some cases the browser may have stopped observing LCP changes prior to this library marking it as "final", but the benefit is LCP observations will not be incorrectly stopped early if a site programmatically calls an API like window.scrollTo().

For most developers using this API to send data to an analytics service, they should not see a difference in what is reported (except for sites that were using window.scrollTo() and reporting incorrect data). However, anyone using the web-vitals-extension may notice that LCP is no longer marked as "final" after a user scrolls.

cc: @addyosmani

@philipwalton philipwalton merged commit 2e95d78 into v1 Nov 10, 2020
@philipwalton philipwalton deleted the remove-scroll-lcp branch November 10, 2020 04:13
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