Chrome on iPhone give incorrect window.innerWidth window.innerHeight after orientation

Viewed 193

My webpage is running on Chrome 99.0.48.44.59 on iPhoneX

When I rotate the device few times it start to give incorrect window.innerWidth and height

I put a timer and keep printing the values. They don't seems to give the correct values.

Tried

window.innerWidth ,  window.innerHeight

document.documentElement.clientWidth ,document.documentElement.clientHeight

window.visualViewport.width , window.visualViewport.height

All of them give invalid values.

Does the content I display on the webpage affect innerWidth and height?

Is there a way to get correct width and height?

0 Answers
Related