Skip to content

Yield on LiteYTEmbed click listener to reduce INP impact #180

@gilbertococchi

Description

@gilbertococchi

RUM data on some project I have suggested that "lite-youtube.lyt-activated>button.lty-playbtn" interaction is causing large INP.

I would suggest yielding on the Click Event Handler doing something similar to this and improve the UX somehow like changing the Playback icon status etc to improve UX on top of INP.

this.addEventListener('click', function(event) {
            event.preventDefault();
            requestAnimationFrame(() => {
                setTimeout(() => {
                  if (this.classList.contains('lyt-activated')) return;
                  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions