jaredLunde/react-hook

[useWindowSize()] Visual Viewport Support

coopermaruyama opened this issue · 1 comments

I have implemented visual viewport support into useWindowSize() and would like to propose merging upstream.

While working with webviews I discovered that useWindowSize does not update and reports the wrong window height in the case where the size of the webview changed. Most likely this is not the only case where the window height can change without being reported by an event listener on window.

By also listening to the resize event on window.visualViewport this issue can be fixed.

Implementation

Sounds good to me!