Keyboard overlaps the text input when the input is placed inside an <ion-footer>
Short description of the problem:
When an <ion-input type="text"> is placed inside an <ion-toolbar> in an <ion-footer>, the iOS keyboard overlaps text inputs placed in an <ion-footer> and the entire page "jumps" when the input receives focus.

What behavior are you expecting?
I would expect the text input to be shown above the keyboard so the user can see what they're typing, similar to what happens in the Messages app on iOS. I also wouldn't expect the entire page to jump down immediately after the input receives focus.
Steps to reproduce:
- Create a new project with the
blanktemplate - Add the following to
home.html, run the app on iOS, and focus on the text input
<ion-footer>
<ion-toolbar>
<ion-input type="text" placeholder="Add a message..."></ion-input>
</ion-toolbar>
</ion-footer>
Which Ionic Version? 1.x or 2.x 2.x
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.2.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.31 Ionic App Lib Version: 2.0.0-beta.17 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.2.3 Xcode version: Xcode 7.3.1 Build version 7D1014
Is there any update on this issue yet please? I first raised this with @mhartington a while ago and this really has been a very longstanding issue now.
I put a lot of effort into demonstrating the issue here (https://github.com/driftyco/ionic/issues/5432 ) but it seems that this has been close for a while.
Ionic team - this is a really important issue for my apps - please can we have an update.
Apologies if I am unaware of a fix or workaround that has gone in.
Look forward to hearing from you.
I'm my particular situation I had an input in .bar-footer. The following CSS seemed to fix the issue:
body.keyboard-open.platform-ios .bar-footer {
bottom: 36px;
}
NOTE: There is a bit of a delay before .bar-footer jumps up above the keyboard because of there being a delay before the .keyboard-open class gets attached to the body.
But then when you start typing you'll notice that your text isn't reflecting in the input field. That's thanks to the "fix" Ionic puts in place for "some keyboard issues while scrolling". To disable this you can do the following:
window.ionic.tap.cloneFocusedInput = function () {
return null;
};
That will overwrite and disable cloned inputs. After that, everything seemed to be working fine.
Thanks @Tiwaz89 - any idea how to get the keyboard to stay open in-between messages. Problem demonstrated in gif below.
Also both autocomplete and spellcheck options for the ion-input do not work....

Found a solution here: https://stackoverflow.com/questions/32730171/ionic-footer-input-field-being-hidden-by-keyboard-in-chat-app
set fullscreen property to value false in config.xml
This goes out out to anyone that's had a similar problem with the ionic footer and inputs in cordova build. If you have this preference in config.xml
<preference name="fullscreen" value="true" />The keyboard will hide the input when it's activated. If you absolutely need to see that input when typing (that was a joke) than just set it to false and it should solve the problem.
Anything better than a workaround or third-party solution?
@Tiwaz89 : Can you please help where I need to place this code? window.ionic.tap.cloneFocusedInput = function () { return null; }; I am currently facing lag during the input as the footer takes time to appear on top of keyboard.
This worked for me, assuming all you ion-input are wrapped with ion-content. Pure JS works with Typescript as well.
var ionInputs = document.querySelectorAll("ion-input");
Array.prototype.forEach.call(ionInputs, function (e) {
e.addEventListener("focus", function (e) {
let scroll=this.offsetTop;
/*somehow this doesnt work when keyboard is showing up, so have to wait till it is shown . You can also use native keyboard plugin and use the native event:
window.addEventListener('native.keyboardshow')*/
setTimeout(()=>{this.closest(".scroll-content").scrollTop=scroll},400);
}, true);
})
I am resolved this bug with my logic for all ionic 1 and ionic 2 var old_height = window.innerHeight; $scope.checkheight = function(){ console.log("BEFORE window.innerHeight",window.innerHeight) var new_height = window.innerHeight; var keyboard_height = (old_height - new_height) ; $('.bar-footer').css('bottom',keyboard_height+'px') keyboard_height = (keyboard_height + 50) ; $('.chat-main').css('bottom',keyboard_height+'px') $ionicScrollDelegate.scrollBottom(); } keyboard = $interval(function () { $scope.checkheight(); }, 300);
Call this function into interval interval always check your keyboard height and showing your keyboard with input Thanks
take care using intervals, @sohandhaindwal you can degrade app performance...
@jdnichollsc I was just give a logic , you can achieve this without interval. like on focus or etc.
It is fixed?
so I am still having this problem, any fix?
This directive worked for me at iOS11 & iPhoneX.
https://gist.github.com/rdlabo/57bb9a2098f2f83c2c1cc16c8e88f6d5
@rdlabo Thanks, i just tried that, it works great, but the header seems to slide with the content initially, is that how it works?
the header seems to slide with the content initially
@yaozuwang Sorry. I can't fix this problem... I expect you will fix !
@rdlabo lol ok hahaha
@rdlabo , @yaozuwang , @onedou use ionic cordova-plugin-ionic-webview plugin for this issue ionic 2 provide default but ionic 1 not so you have to manually install this thanks
Any solutions for this issue guys?
I could not reproduce the error, but I have a bad result when the keyboard is changed to "emoji". The keyboard height is bigger then, overlaps the input and does not push it up at all.
@jgw96 you said quite some time ago that you are looking into the issue with the chrome dev team. Has there been any more insights?