Skip to content

All scroll events triggered immediately on first screen #10

@m12y

Description

@m12y

I'm using the following code:

const scrollTracker = window.ScrollTracker();
scrollTracker.on({
  percentages: {
    every: [25]
  }
}, evt => {
  console.log("Scroll tracking:");
  console.log(evt.data.label);
  console.log(evt.data.depth);
});

As soon as the page loads, I get the following output immediately:

Scroll tracking:
25%
235
Scroll tracking:
50%
471
Scroll tracking:
75%
707
Scroll tracking:
100%
943

It seems to be considering the first visible window as 100%, because the height of my browser window is 943. Scrolling further down the page doesn't trigger any more events.

I'm using Chrome 74 on macOS 10.14, and it happens for all pages I try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions