stutrek/scrollmonitor

In Viewport calculation is off by one

Closed this issue · 5 comments

Check out these examples where I have created two boxes:

In the first example, they are both have heights of 100vh. Note that they both register as in viewport even though the second box should be pushed out of it by the first, which should completely fill the viewport.

In the second example, the boxes have heights of calc(100vh + 1px). Now, the second box correctly registers as being out of the viewport.

😮

Is it consistent between browsers?

Yeah, happening in latest chrome, firefox, safari as well as IE edge.

🍻

Did you publish to npm? Not seeing it there:

Oops, published.