Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some field of getViewport returns 0 instead of the actual value #101

Open
lilpacy opened this issue Dec 16, 2019 · 0 comments
Open

some field of getViewport returns 0 instead of the actual value #101

lilpacy opened this issue Dec 16, 2019 · 0 comments

Comments

@lilpacy
Copy link

lilpacy commented Dec 16, 2019

We experienced that y field of getViewport return value is 0 instead of the actual value.

This is our code.

window.onpopstate = () => {
  console.log(window.pageYOffset);
  app.ports.onPopState.send(location.href);
};
        PopState here ->
            let
                _ =
                    Debug.log "PopState" here
            in
            ( model
            ,  Task.perform GotViewPort Browser.Dom.getViewport
            )

        GotViewPort viewport ->
            let
                _ =
                    Debug.log "vp" viewport
            ....

Screen Shot 2019-12-16 at 18 00 37

getViewport of Elm wraps window.pageYOffset of Javascript, but is it wrong?

Screen Shot 2019-12-16 at 17 58 17

@lilpacy lilpacy changed the title y field in the return value of getViewport was 0 instead of the actual value. y field in the return value of getViewport was 0 instead of the actual value. Dec 16, 2019
@lilpacy lilpacy changed the title y field in the return value of getViewport was 0 instead of the actual value. some field of getViewport returns 0 instead of the actual value Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant