Why does Browser.Events.onResize not return a viewport

This may well be the stupidest question in the forum but I don’t quite understand why onResize doesn’t return a Viewport instead of height and width. The reason why I’m asking is lets say I want to get the Viewport on resize then first I’d have to subscribe to onResize and then after that completes I’d have to perform the getViewport task. Now this seemed quite redundant to me, or ma I getting it wrong?

Any explanation would really benefit me and thanks Evan for creating Elm.

2 Likes

Does the onresize event provide enough information to extract the Viewport from?

Perhaps it only gives enough to figure out the width and height, but not the scroll position?

Also, I think that if you change the scroll position, then onresize will not fire, but the Viewport will be different.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.