[generic] iOS - wkwebview does not shrink on keyboard open

Dear all,

my question is related to iOS (swift) + wkwebview (without cordova).

When the softkeyboard opens the size of the WKWebview does not change, resulting in issues e.g. in case of searchbars (the searchbar + header can be scrolled out of the visible area).

some pieces of the code:

@IBOutlet weak var    webViewContainer:UIView?
var    webView:WKWebView?
@IBOutlet weak var   banner:GADBannerView?

generation of the webview:

let webViewCfg = WKWebViewConfiguration()
webViewCfg.userContentController.add(self, name: “native”)

webView = WKWebView(frame: webViewContainer!.bounds ,configuration: webViewCfg )
webView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
webView!.navigationDelegate = self
webView!.uiDelegate = self
webView!.scrollView.bounces = false
webViewContainer?.addSubview(webView!)

if let result = components?.url {
let request = URLRequest(url: result)
webView!.load(request)
}

In iOS Simulator + Safari to inspect the webview, I noticed that the size of the webview does not change, when the keyboards is opened.

Is this true? How to handle it?

Best regards
Andreas

In Cordova there is a plugin which does it or at least allow to handle the keyboard open/close events. Without it, i am not sure, you better to ask on iOS developers forum