-
Notifications
You must be signed in to change notification settings - Fork 396
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
Keyboard Dismissal Leaves Viewport Shifted in iOS 12 / XCode 10 #176
Comments
I have find why, in: |
If you want to check also iPad (and this why on iPad was working with iOS 12 and mybe not working with iOS 11) |
Thanks so much @Stefano1964! I just discovered this pretty catastrophic bug today! I second your merge proposal 👍 |
please create a PR |
The fix breaks the display in iPhone X and later models (XR, XS, and XS Max) for those that are using Ionic, where the extra spacing initially complained about when the keyboard disappears now becomes an issue as soon as the app is opened. The fix is an easy CSS change, at least for Ionic v1 apps: .view, .view-container { height: calc(100% + env(safe-area-inset-top) + env(save-area-inset-bottom); } At least it's now obvious where the extra spacing is coming from. |
I am also witnessing the initial offset that the referenced patch creates in iPhoneX variants and can verify that @revie 's CSS tweak (applied to |
Hi, I tried multiple things to get this fixed, including the CDVWKWebViewEngine.m thing above and tweaking options to the cordova-plugin-ionic-keyboard among other things. Finally, the only thing that helped was to download XCode 9.4, add iOS 12 device profiles and build using that version. According to initial testing, this seems to work on iOS 12 devices also on iPhone X. |
Changing CDVWKWebViewEngine.m worked for me except now the entire window height was off as mentioned above. The css for .view did not help, instead I did html { height: 100vh; } to solve the issue. BUT now platform.height() responds with the original height (which is of course incorrect)... It seems my hacky fix has just led to more issues. This is a pretty critical bug imo.. anyone else experiencing this or have a fix? |
I've created a sample project with the bug https://github.com/jcesarmobile/webview-input-bug It's a tabs project with an This is a WKWebView bug on SDK 12, so the real fix can only be provided by Apple, or use some workaround, those are the options:
If not using Ionic and you think the linked PR fixes the problem there, provide a sample app. I've tested the PR changes in my project and didn't fix the problem. |
Could use some testing on the above PR (#201) ^
/cc @mobidev111 @jcesarmobile @NG-tylerholden @jkervine |
And UIScrollViewDelegate
Worked |
This did work for me. ViewController.h
ViewController.m
|
I solve this bug with these command lines on app.components.ts:
|
Which ViewController.h and .m are you referring to? I dont see such files inside my cordova project folder. Also, just changing the keyboardwillhide and keyboardwillshow methods in CDVWKWebviewEngine inside the ionic-wk-webview-plugin files did fix the problem for ios13 but causes the viewport to have a bounce effect on ios 12 when shifting focus between text fields. |
…#176) (ionic-team#399) - We only need the KeyboardWillHide event to fix this problem, and we only need it for ios 11+ - Enable the fix for ios 11+, not only ios 12+. It was probably only 12+ becase no devices have a max OS of 11, so no dev probably confirmed the problem's existance (or non-existance) on 11, myself included. (But the functionality that started this issue chain began in ios 11.) - Do some math to make sure the offset when the keyboard goes down dosen't result in empty white space being displayed. - This solution can potentially be removed when apple finally releases the fix for the issue discussed here: apache/cordova-ios#417 (comment))
…#176) (ionic-team#399) - We only need the KeyboardWillHide event to fix this problem - Do some math to make sure the offset when the keyboard goes down doesn't result in empty white space being displayed. - This solution can potentially be removed when apple finally releases the fix for the issue discussed here: apache/cordova-ios#417 (comment)
…#176) (ionic-team#399) - We only need the KeyboardWillHide event to fix this problem, and we only need it for ios 11+ - Enable the fix for ios 11+, not only ios 12+. It was probably only 12+ because no devices have a max OS of 11, so no dev probably confirmed the problem's existence (or non-existence) on 11, myself included. (But the functionality that started this issue chain began in ios 11.) - Do some math to make sure the offset when the keyboard goes down doesn't result in empty white space being displayed. - This solution can potentially be removed when apple finally releases the fix for the issue discussed here: apache/cordova-ios#417 (comment)
…#176) (ionic-team#399) - We only need the KeyboardWillHide event to fix this problem, and we only need it for ios 11+ - Enable the fix for ios 11+, not only ios 12+. It was probably only 12+ because no devices have a max OS of 11, so no dev probably confirmed the problem's existence (or non-existence) on 11, myself included. (But the functionality that started this issue chain began in ios 11.) - Do some math to make sure the offset when the keyboard goes down doesn't result in empty white space being displayed. - This solution can potentially be removed when apple finally releases the fix for the issue discussed here: apache/cordova-ios#417 (comment) For full details see PR ionic-team#532
…#176) (ionic-team#399) - We only need the KeyboardWillHide event to fix this problem - Do some math to make sure the offset when the keyboard goes down doesn't result in empty white space being displayed. - This solution can potentially be removed when apple finally releases the fix for the issue discussed here: apache/cordova-ios#417 (comment) For full details see PR ionic-team#533
I think it's a bug in ionic plugin (without the cordova-plugin-ionic-keyboard installed):
apache/cordova-ios#417
The text was updated successfully, but these errors were encountered: