-
Notifications
You must be signed in to change notification settings - Fork 985
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 #417
Comments
Does this happen in a plain Cordova app without the Ionic WebView plugin? Does it happen if you use the Apache version of the WKWebView plugin ( |
@dpogue - I AM seeing this when replacing |
Are you using I'm trying to reproduce this in an iOS 12 simulator with Xcode 10 and plain WKWebView, and I don't see it doing anything different than iOS 11, but that might also be because my page scrolls. |
We are for iPhoneX / notch support:
I'm not seeing the issue when removing the |
Was afraid of that. Thanks for confirmation / isolation @dpogue . If you link the issue here, I'll be sure to try and weigh in on its importance, etc. |
Radar filed as rdar://44655885 Please file duplicate radar reports at http://bugreporter.apple.com! |
In one af my app i had to use the ionic wkwebview (i dont use ionic framework) as this version allow to access files outside the app directory and the standard cordova wkwebview doesn't allow this kind of access. |
Hello! In my case i updated cordova-plugin-ionic-webview up to ="^2.1.4" Ionic: ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic) Cordova: cordova (Cordova CLI) : 8.0.0 System: ios-sim : 5.0.13 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Experience same without Cordova, using pure WKWebView. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
For the record, I strongly suspect the issue was introduced as a side effect in WebKit/WebKit@0ff63c4 |
Thanks for doing some digging @dpogue . I've written the author at Apple, so hopefully there is some visibility internally there, now. 🤞 |
We found building with Xcode 9 as opposed to 10 reverted any weird keyboard issues (obviously not long term solution) |
…#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
This has been fixed in iOS 13.4. |
here - Fix(iOS): Issues related to keyboard dismissal (4.x) ionic-team/cordova-plugin-ionic-webview#533, they recommended to use cordova-plugin-wkkeyboardfix. Has anyone used this recommended cordova-plugin-wkkeyboardfix plugin and published in Apple Store? While using this plugin, the issue has been fixed but they gave note as - plugin is a hack around a bug in iOS. It might result in your app being rejected from the App Store!. Anyone can check and let me know your suggestion to go with this plugin cordova-plugin-wkkeyboardfix. |
@andaralex Yes my app was approved without any problem. |
@jacobg Thanks for your comment, then I will move with this plugin cordova-plugin-wkkeyboardfix. |
@andaralex it was fixed with iOS 13.4 not need that fix anymore, btw answer to your question was already in the thread a few times don't hesitate to use search next time |
@Kepro iOS 13.4 has indeed been fixed. @andaralex So, depending on how many iOS 12 users you have, you may still want to use the fix. |
Still experiencing this issue. Looked all over the net and all over issues referenced here — workarounds here didn't work like scrolling to the top of the page Related deps: Related <preference name="KeyboardResize" value="true" />
<preference name="KeyboardResizeMode" value="native" /> I've tried setting |
@wswoodruff I have the same problem, did you find a solution? |
@EW-93 @wswoodruff I'm having the same problem and none of the solutions mentioned in the thread have solved it. Did either of you have any luck? EDIT: Turned out to be a safari css bug caused by a combination of onscreen datepicker and keyboard with a resizing viewport. Sorry for the noise. |
@jagu2012 For me it was something really stupid, somehow I had accidentally put another meta viewport tag in a component which overwrote the one in index.html. |
Guys, this issue should have been fixed long time ago by Apple. It did take them a year to release the update but it shouldn't be an issue anymore. |
@TxLiFE Sorry my fault. This turned out to be a subtle bug that could be replicated in the web (non cordova wrapped) interface as well. A mix of Safari, flexbox and NNvh css. I'm sorry for taking your time. |
@jagu2012 Not blaming you, but people need to read through this issue, work around has been provided. And do update your dependencies. |
this worked for me jQuery('input, textarea').focus(function(){ |
apache/cordova-ios#417 does not apply to WKWebView, therefore always return NO when running there. This entire workaround to disable viewport fit injection is to be _removed_ once WKWebView is the _sole_ option. References https://outsystemsrd.atlassian.net/browse/RNMT-3245
Seeing a blocking issue after updating to XCode 10 related to keyboard displacement and then dismissal.
When an input that would require webview centering is clicked, the viewport is repositioned to center that input, as iOS has traditionally done. However, when dismissing the keyboard, the viewport is not re-positioned properly back to its original position.
This can leave large gaps where the webview is no longer visible. In the attached screenshots, you can see that this leaves a large margin where the viewport is rendering, shifted upwards and off-screen by a 100+ pixels. There appears to be no way do re-position the viewport short of additional input focus changes, each resulting in similar offset issues.
To add some additional confusion, it appears this only happens on iOS 12 / XCode 10 produced installs, such that:
Any info on potential workarounds or patches would be greatly appreciated. I've already looked into upgrading our
cordova-plugin-ionic-webview
plugin (as well as various others), but it appears to not have any relevance with the issue. At this point, we're looking at downgrading XCode in order to get working builds out.Click Here to See Example Screenshots
Captured via iOS Simulator, but also experienced on various physical devices running iOS 12
Prior to focusing an input:
Input focused: / keyboard present
Keyboard dismissed / HTML element highlighted in inspector:
Click Here for Environment Details
OS: OSX 10.13.6 (High Sierra)
XCode: 10.0 (10A255)
cordova: 8.0.0
cordova-ios: 4.5.4
cordova-plugins:
The text was updated successfully, but these errors were encountered: