elm / browser

Create Elm programs that run in browsers!
https://package.elm-lang.org/packages/elm/browser/latest/
BSD 3-Clause "New" or "Revised" License
312 stars 64 forks source link

getViewport returns incorrect viewport height #118

Open ghost opened 4 years ago

ghost commented 4 years ago

getViewport returns the viewport height the same as the scene height when the page is taller than the browser window. The viewport height should be less than the scene height.

Oddly, an SSCCE for Ellie doesn't reproduce the issue: https://ellie-app.com/9LzKBNqhf7Va1 (see console logs)

I've tried on two different computers, same problem. Same in Chrome and Safari. I suggest downloading the Ellie to try it on your machine to reproduce the problem.

Augustin82 commented 3 years ago

We've been affected by this as well.

Our workaround was to use a "reference" element in the viewport, that is at position 0, and use its position to compute the actual viewport offset.