Code Monkey home page Code Monkey logo

Comments (3)

philipwalton avatar philipwalton commented on May 23, 2024

We noticed that getCLS(onReport) is only firing when the user changes to another tab.

That is intended, as that's the point when the metric value should be reported to an analytics server (i.e. in the visibilitychange event). See the docs on getCLS() for more details.

An animation triggered by a hover event is reporting as hadRecentInput: false, these seem to be related to different children elements having "transform: " properties.

The hover action is not considered "user input"—that's limited to things like tap, click, and keypress, so if layout shifting is happening on hover, it's expected that it will increase CLS.

We also noticed that a child element of hover animated element has backface-visilbity: unset, our hero carousel image (a sibling element of a higher parent container element) then triggers CLS entries (with reportAllChanges = true), however with backface-visiblity: hidden the hero carousel no longer triggers CLS, but hovering in and out from the animated element does trigger CLS again.

Sorry, it's a bit hard to follow exactly what you're describing, are you saying there is layout shifting going on, but you can't see it?

I have recorded a video of the steps above, please let me know if you would like to see it.

Yes, a video would be really helpful. And a demo (if you have it) would be even better.

from web-vitals.

skaraman avatar skaraman commented on May 23, 2024

Thank you for clarifying the first two points @philipwalton! We figured that was the case for the hidden state change, but had to make sure.

For the hard to follow behavior please follow this link and request access: https://drive.google.com/file/d/1bY3JAUW-_5VWxFIpI3HR0ldiXs11KnHz/view?usp=sharing

Unfortunately, we do not have a public facing demo but if you need additional details just let me know and I will try to provide as much context as possible.

from web-vitals.

philipwalton avatar philipwalton commented on May 23, 2024

I'm going to close this as I believe the issue is related to the Layout Instability API and not this library. If this is still a problem for you, I'd recommend filing an issue with that spec or directly in Chrome (via crbug.com).

from web-vitals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.