Experiencing some unexpected behavior with iOS mobile safari on version 13.3.
I have a website that functions as a single page application for the most part. Due to this, I have set its height/width at 100% and adjusted the content accordingly. While everything works perfectly on other browsers and devices, iOS Safari is presenting an issue when transitioning from portrait mode to landscape mode, and then back to portrait mode.
The problem seems to be related to the navigation bar/toolbar and how the viewport expands when it hides. When testing on an iPhone 8 Plus, upon loading the page with the bars visible, the height reads as 622px. Upon rotating to landscape mode, the height shrinks to 414px. However, when rotating back to portrait mode, even though the bars are hidden (or reduced in case of the navigation bar), the height remains 622px. This results in a significant gap at the bottom of the page where window.innerHeight
still registers it at 622px. Opening and closing the navigation bar causes the view to adjust correctly, showing a height of 697px.
If I switch from using percentage-based sizing to viewport height (100vh) instead, the page extends behind the bars.
Any advice or insights would be highly appreciated!
Upon Initial Loading:
https://i.sstatic.net/kISSB.png
After switching to landscape and back to portrait: