Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

white space after update cordova 6.0.0 #905

Closed
kamhawy4 opened this issue Jun 17, 2020 · 7 comments
Closed

white space after update cordova 6.0.0 #905

kamhawy4 opened this issue Jun 17, 2020 · 7 comments

Comments

@kamhawy4
Copy link

appeared me white space after update cordova 6.0.0

Image from iOS

\\\\

and after close keyboard. appearing in large more

\\\\

Image from iOS-2

@dpogue
Copy link
Member

dpogue commented Jun 17, 2020

See #417.

This was a bug in iOS between iOS 12.0 and iOS 13.4 when using WKWebView.
https://www.npmjs.com/package/cordova-plugin-wkkeyboardfix is available as a unofficial/unsupported workaround.

@dpogue dpogue closed this as completed Jun 17, 2020
@lovelyelfpop
Copy link

Add some code in CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m

    // re-create WKWebView, since we need to update configuration
    WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
    // add begin
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
    if (@available(iOS 11.0, *)) {
        [wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
    }
    #endif
    // add end
    wkWebView.UIDelegate = self.uiDelegate;

@dpogue
Copy link
Member

dpogue commented Jul 18, 2020

@lovelyelfpop We have said many times, we will not set UIScrollViewContentInsetAdjustmentNever because it removes control from the app author. Every app should define their content inset behaviour with the viewport-fit meta tag.

@lovelyelfpop
Copy link

lovelyelfpop commented Jul 20, 2020

We've already set viewport-fit=cover, but there is still white space at the first launch, after resume from background, the white space disappears. Or turn to landscape and back, the white space disappears, too.

If use viewport-fit=cover and body {height:100%}, the height of html body still can not reach the bottom, but the background-color of body can cover the fullscreen(so it's a body backgroundColor space rather than a white space).

Change height: 100% to height: 100vh fix the problem, but is has other side effects.

Maybe add a new <preference> to control it?

@21pg
Copy link

21pg commented Dec 15, 2020

Agree with @lovelyelfpop ,
I can confirm viewport-fit=cover not resolving this problem.
At first launch there is a white space below to notch on iPhone X and iPhone XR and it goes when we switch App in background/foreground
I also tried height: 100vh in body/html tag. It giving me result like this-
IMG1

While i expected this-
IMG2

@lovelyelfpop
Copy link

Add a new preference would shut us up

@lovelyelfpop
Copy link

I write a plugin for cordova-ios@6+ to solve this issue
https://github.com/lovelyelfpop/cordova-plugin-wkwebview-inset-adjustment-never

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants