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

Improve LCP accuracy by ignoring some clicks/keypresses #101

Closed
smhmic opened this issue Nov 23, 2020 · 2 comments
Closed

Improve LCP accuracy by ignoring some clicks/keypresses #101

smhmic opened this issue Nov 23, 2020 · 2 comments

Comments

@smhmic
Copy link

smhmic commented Nov 23, 2020

Right now the library allows inert clicks and keypresses (i.e. user clicks on 'loading' gif) to skew LCP scores lower. Two ideas for mitigating this:

  1. Do not allow user clicks and keypresses to deactivate LCP monitoring until FID.
  2. Offer a way to customize which inputs/elements deactivate LCP monitoring.
@philipwalton
Copy link
Member

This library adds a click and keydown listener just as a means of reporting the "final" LCP value sooner. It does this because the underlying Largest Contentful Paint API itself will stop listening for new largest paints after user input or scrolls (see #75 to know why this library stopped listening for the scroll event).

If w3c/largest-contentful-paint#43 in the LCP spec is addressed, this library will not have to use the click and keydown listeners, and it can just rely on the underlying API to know when observation has stopped.

@philipwalton
Copy link
Member

I'm going to close this issue since I don't think there's any action this library needs to take at this time.

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

No branches or pull requests

2 participants