bug: Keyboard on IOS9 issues
Type: bug
Platform: ios 8 webview
Its related to IOS9
After updating my ios version to IOS 9,on input focus, the whole page flicker, gets pushed down then pulled up.. and a white background shows then disappears after the page gets pulled up.
I had problems with
$ionicConfigProvider.scrolling.jsScrolling(true);
with iframes in my scrollable content (e.g. youtube embed player). If user starts scrolling by tapping on iframe, it doesn't work. With
$ionicConfigProvider.scrolling.jsScrolling(false);
it works. The user can tap everywhere to start scrolling. So JS-Scrolling is no option if you have iframes embedded in your content.
Do not use $ionicConfigProvider.scrolling.jsScrolling(true);, it will turn off native scrolling in your app, which will affect the performance:
http://ionicframework.com/docs/nightly/api/provider/$ionicConfigProvider/
What you really have to do is to make sure that your keyboard plugin is properly installed.
Open your app.js file and somewhere in the "run" function you should have the following code:
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.disableScroll(true);
}
Try to use an "alert" function just to make sure that your plugin is there:
if (window.cordova && window.cordova.plugins.Keyboard) {
alert('My keyboard plugin is working!');
cordova.plugins.Keyboard.disableScroll(true);
}
Now, make a new build and run the app on your phone/simulator. From this stage, you have two options:
- If you see the alert message then your plugin is there and everything should be okay;
- If you don't see the alert message it means that something is wrong with your plugin and this is the reason why you're getting all these weird issues with inputs;
I have the same issue with 1.3.1 When form content is less then height of scrollable content it disappears when blurring input element (keyboard closes). In order to have a reflow i added this to my bottom form
<ion-item class="item-borderless hide-on-keyboard-open"> </ion-item>
which did the trick, as "pschuler" mentioned in forum
its still buggy because now and then the content will not even scroll at all (when form becomes bigger because of user input). I didnt experience it before because i used non native scrolling by default.
Hi.. I'm also facing the same thing where the issue is:
- there have a gap after keyboard is closed (the gap size is equal to keyboard size).
And I'm was try my luck using simple fix by adding:style="height:90% !important;" into <ion-content> tag.. And its working fine now.. :)
Another alternative is by modified the code like this:
window.addEventListener('native.keyboardhide', keyboardHideHandler); function keyboardHideHandler(e){
var keyBoardGap = document.querySelector("#chatContainer"); keyBoardGap.classList.add("heightForce");
}window.addEventListener('native.keyboardshow', keyboardShowHandler); function keyboardShowHandler(e){ var keyBoardGap = document.querySelector("#chatContainer"); keyBoardGap.classList.remove("heightForce"); }
CSS:
.heightForce { height:90% !important;}
Hope this helps others :)
i added this to my css
// iOS 9 fixes
.platform-ios {
.scroll-content {
> .scroll {
min-height: 101%;
}
}
}
.overflow-scroll,
.overflow-scroll.pane {
overflow-y: auto !important;
}
101% produces a scroll bar but it's worth it if you can fix this ugly issue, also it's better to use min-height instead of height to not limit vertical expansion of your content (but depends on content of course)