apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

Fix - WKWebView doesn't layout properly at initial launch (CB-13987) #989

Closed anujraghuvanshi closed 3 years ago

anujraghuvanshi commented 3 years ago

Platforms affected

iOS

Motivation and Context

WKWebview was adding extra space at footer section at initial launch when app is installed in device. Getting fixed when app is killed and re-launched.

Issue - https://issues.apache.org/jira/browse/CB-13987

Testing

Tested in iPhone XR. Earlier I've forked cordova-plugin-wkwebview-engine plugin and was using that, But now I've updated to cordova-ios@6.0.0 so its needs to be fixed here now. This fix works correctly.

dpogue commented 3 years ago

We've rejected this change several times, because control over the safe area insets should be up to the app developer using the viewport-fit meta tag. Cordova should not override developers' control over their apps.

The usual cause of these layout issues is setting height: 100% or min-height: 100% on the body element. 100% and 100vh behave differently with safe area insets, and 100vh is almost always what people want: