-
Notifications
You must be signed in to change notification settings - Fork 345
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
IOS 11.1.1 WKWebView ShrinksView shrinks view twice on first focus #64
Comments
I can confirm this behaviour on iOS 11.1.1 on iPhone 7 Plus. |
Can confirm here on iPhone 7. This is pretty critical, apps are broken because of it. |
Do any of you have sample code that displays this behavior? I've tried reproducing it on an 11.1.1 5S Device and 11.1 iPhone 7 Sim. |
I'm using the following: IPhone 8, IOS 11.1.1 (real device) Cordova version 7.1.0 IOS platform version 4.5.2 cordova-plugin-wkwebview-engine 1.1.3 cordova-plugin-keyboard 1.1.4 (also tried 1.1.5 but got same behaviour)As far as I can tell i haven't done anything special to a project with the above setup. Attached is a video of the behavour. The blue highlighting is me focussing the window with safari dev tools to show what the window height is at each point in the demo. Also there is a regular input as well as my customised ones to prove that the input's javascript / html is not effecting it. You can see where the window gets cut off on focussing inputs. Sorry I don't have a sample project available for public inspection. |
Don’t really have a project I can share but I can tell you it started after iOS 11.1.1 because apps installed prior to the update, and apps being installed now are both showing the same behavior. I have disabled the shrink view for now as fix. |
Thanks for the video repro. It looks like WKWebView is the key here. Once I add that plugin, I can reproduce on both the device and simulator. |
This appears to be caused by something in the WKWebView keyboard event listener, but I'm not sure exactly what. We already remove those handlers for iOS 8-10, so I think the easiest solution is to remove them for 11 as well. There's actually already a commit doing this to fix a different bug (#55) but it hasn't been released to npm yet. Does installing the latest from github fix the issue for you? |
Hey I downloaded the master branch and replaced the CDVKeyboard.m file in my project with the new version and my IPhone 8 ios 11.1.1 is now functioning correctly with shrink view. My old device on ios 10 is still working perfectly aswell so I would say this is now resolved for me. Thank you for the help! |
Thanks for the confirmation. I've pushed 1.2.0 to npm, so if you remove and re-add the plugin you should get the update. |
It's working on older versions of ios but in the latest (11.1.1 on iPhone 8) it seems to set the window height to a very small number the first time you focus an input.
I suspect from what i have observed that it is subtracting the keyboard height twice from the webview.
If you have 2 inputs and you focus one, then focus the other the correct webview height is applied. But the first time you focus an input from an unfocussed state the window shrinks too much.
The text was updated successfully, but these errors were encountered: