-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: Keyboard issue (iOS 8/9) #5489
Comments
Yeah I get the screen jumping as well. I'm not as concerned with the jumping (though it is kind of unattractive), as I am with the keyboard initially covering lower inputs (as described in my comment in the forums).
Here's a gif of me trying to debug it, but after viewing the commit that was supposed to fix this, I'm clearly out of my depth. Some help would be greatly appreciated... @mlynch ? |
Hey guys, let's see if we can get to the bottom of this. First, you're sure the keyboard plugin is installed properly? Second, do you have this line in your app.js: https://github.com/driftyco/ionic-app-base/blob/master/www/js/app.js#L18 This was a fixed issue so want to see what's going on. Also @tlancina can you jump in here? |
Also, from safari web inspector:
I assume that this indicates the plugin is installed properly but if there's more to it, please let me know. I did not have that line in my app.js, however, after adding it and running my app in the simulator again, I've found the behavior is very much the same as before. I'll build to my phone tomorrow to see if that's any different... |
I used "sidemenu" example and that line is definetly there: if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
} I will try to debug it to make sure this code is executed. |
Okay, I think I got something. Following code is not executed at all (running in Ionic View): if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
} Just wondering, for "sidemenu" app we're using latest version of keyboard plugin, which is 1.0.8, but Ionic View is using 1.0.3: http://docs.ionic.io/docs/view-usage I tried to change my |
Finally solved it. So basically the problem is that The simplest solution is to modify main index.html file and put following code there (before any JavaScript library is loaded): <!-- ionic view hack -->
<script>window.cordova = {};</script> |
Closing issue, thanks for your help. |
Just a follow-up, sorry you ran into this annoying gotcha in View. Because scripts can only be injected into an inAppBrowser (which is what View is) after page load, Glad you got it working! |
That's something we could fix in view, right @tlancina? |
It's been a while since I visited the issue, but I seem to recall struggling to introduce any window properties before page load. Localstorage is unreliable and can be cleared, and any indicators from native require the Cordova bridge to be initialized, which is being skipped in this case. We could modify user files on upload to include I think it might be easier to add a check for something like a custom View user agent into the framework: https://github.com/driftyco/ionic/blob/master/js/utils/platform.js#L197, but that felt slightly dirty. Unfortunately nothing straightforward, or it would have been fixed already. That being said, I think this probably bites more people than any solution would, so fixing it in some way is preferable to letting it continue to cause people headache. |
tl;dr: adding So something strange happened for me when I added The console.log file shows:
Of course I was struck by
App is still stuck on splash screen, however that message went away. So I removed Thanks so much to @mlynch and the rest of the ionic team!! |
For me reinstallation of the plugin didn't work. But I'm talking only about Ionic View, not about hybrid build. |
I'm not sure what you mean @DawidMyslak -- IonicView vs hybrid build. I was only testing in iOS (simulator and with testflight). Did you try adding |
@sdhull Have you ever used Ionic View? The app that you can download from App Store? It's more like container for your JavaScript source code with preinstalled set of cordova/ionic plugins. So when you upload an app there your "plugins" folder is not included. When you create proper build for your iOS devices, all your project files are included, so sometimes you can expect different behaviors. I'm using Windows machine for now and the only way how I can test my app is Ionic View. And yes, in my case using the hack above with empty cordova object attached to the window solves the problem. |
@DawidMyslak ohhh no I've never used Ionic View. One interesting thing to note is that Android didn't have this bug at all (also worth noting I'm using crosswalk), that is to say that upon focusing on text fields, the view didn't jump, and lower text fields were properly scrolled into view. After reinstalling the keyboard plugin, the keyboard on Android is slower. And while it still scrolls lower text fields into view, it does so so slowly that it seems like it's not working. So now I have to make sure the plugin is not installed for Android, and is installed for ios. 😞 |
I have been dealing with this issue since a year with 3 different apps in varying degrees. This issue is definitely not only for Ionic View. Never got a bullet proof solution until now. This ought to be looked into. |
@nwocykra Glad it helped. |
Hi Ionic Team! Looks like the issue is the same than #4645 and ionic-team/ionic-plugin-keyboard#159. Any help would me most welcome! Thanks! |
Type: bug
Ionic Version: 1.x
Platform: ios 9 webview
I'm having issues with input fields on latest Ionic (1.2.4) on my iOS devices. Basically every time when I click on the input field the whole app "jumps".
I think the similar issue was already explained here: #4645
Here is the video showing my problem (iPhone 6 and iOS 8.2, but I've noticed the same behavior on iOS 9.2.1):
https://youtu.be/I21yVtTmuSI
I used the "sidemenu" app in my example, this is the simplest way to reproduce it:
I also modified
my-test-app\www\templates\browse.html
using following code:Then I used Ionic View app to test it:
In the example above I used
<ion-input>
directive, but I also tried regular<label>
tag but the behavior was the same.Is there any way how can I prevent this behavior? I'm designing login screen and few more advanced forms and this issue makes user experience really bad.
The text was updated successfully, but these errors were encountered: