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

Get CLS of 0 in timespan even though navigate gives a nonzero CLS value #15785

Open
aadisarma7 opened this issue Jan 26, 2024 · 2 comments
Open
Assignees
Labels

Comments

@aadisarma7
Copy link

I am using user flows to navigate to a url. Then I am opening a timespan and performing a simple scroll to the bottom of the page. However, after testing this on several websites, I am often getting a value of 0 for my CLS from the timespan even when I get a nonzero value from navigate. I know that navigate can only analyze content available on page load, so the layout shift element must be available at page load, but I do not understand why timespan is not also getting this value. I am starting the timespan before performing any scrolling or other interaction. Furthermore, I am using the PerformanceObserver API and observing several layout shift events during the scroll. Can anyone explain this behavior?

@connorjclark
Copy link
Collaborator

connorjclark commented Jan 26, 2024

User input close to the shift is ignored in CLS metric. Scrolling doesn't count, but other inputs do (see link). Are you only scrolling or doing more on the page?

@aadisarma7
Copy link
Author

I am also performing a click on a selector before the scroll input. However, I have tested it without the click action and am still getting a CLS of 0.

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

No branches or pull requests

2 participants