You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the keyboard is opened in a tabs page (position=bottom), the tabs appear on top of the keyboard.
The expected behavior is to hide the tabs when the keyboard is visible
Steps to reproduce:
Create a starter tabs template
Include an ion-input in the page
Run it on a device and focus on the input element
Maybe a CSS class can be added to the page when the keyboard is open (.keyboard-is-open) so that the behavior can be controlled
This issue is for Ionic 2
Cordova CLI: 5.2.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.9
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS:
Node Version: v4.3.2
Reacted by joan xie, Matthias Stürner, Myck, Swapnil Patwa, Ivan E. Sanchez, David Peherstorfer, Alexander Trakhimenok, Liad Idan, Lee Goddard, nitinsh99 and 7 more
Reacted by Ivan E. Sanchez, janptr and John Clifford de Vera
Yeah, I assume you're under Android. The old keyboard problem...
I saw a talk on PhoneGap conf of @tlancina about the keyboard and it seems to be a pretty hard issue in general!
I can confirm that the bottom tab bar is pushed up upon opening the keyboard in my app under Android, too. But much more worse is covering input fields which are near the bottom. Tim said, one should try to avoid that, but unfortunately there are long lists to edit in my project.
I have postponed the whole keyboard topic to wait and see how it plays out in ionic.
Besides, @tlancina, is there a best practice tutorial about using the keyboard in ionic (integrating the ionic keyboard plugin, init/setting event handlers)?
@jgw96 I noticed you added the enhancement label on this. Since native apps do no behave the same (moving tabs above the keyboard) and the tabs are also limit the actual content real estate to just a couple lines, especially on smaller phones, shouldn't this be consider a more serious issue?
Reacted by Raymond Ativie, Éverton Inocêncio, Gin Takashi Mizuoka, Covve, elless, joan xie, Iason Asimakopoulos, Ivan E. Sanchez, nitinsh99, chiragebiztrait4 and 3 more
This won't work if you have multiple tabs on a page, but I guess you can select them with your CSS directly.
I'm currently running Ionic beta 11
Reacted by Raymond Ativie, Khalid Al-Mutawa, Aaron Oathout, Sebastián Ferreras, Alex, Lee Goddard, Nhluvuko Mathebula, Ana Carolina and Alameer Ashraf Hassan
Reacted by Stewan Silva, Khalid Al-Mutawa, Sebastián Ferreras, Nhluvuko Mathebula and Ana Carolina
Just to mention that enabling Fullscreen mode on Android also fixes this issue for me.
This can be done by setting <preference name="Fullscreen" value="true" />
in config.xml, and optionally adding cordova-plugin-fullscreen if you're using a cordova android platform older than v5.0.0.
Reacted by Darshan Tejani, Raj Kumar, Lee Goddard, Tadija Bagarić, Faisal-Atallah and Carlos Gabriel Gomes de Melo Silva
Reacted by Ivan E. Sanchez, lexiMee, janptr, hasansenturk, John Clifford de Vera and eRomanov
Reacted by Tadija Bagarić, Manuel Araujo and Carlos Gabriel Gomes de Melo Silva
Is this going to be fixed in the next version along with the rest of keyboard issues that are going to be fixed (read something stating that about keyboard issues in another thread) or has this fallen between the cracks?
Reacted by joan xie, finalxcode, Matthias Stürner and Lee Goddard
I make this patch (I put in a the controller of affected view, as I only have one with this combo).
/* HACK Al mostrar el teclado el tabbar se pone encima de él en android*/
var bottom_stored=0;
window.addEventListener('native.keyboardshow', function (e) {
angular.element(document.getElementsByClassName('tab-nav')).addClass('hide');
bottom_stored = angular.element(document.getElementsByClassName('has-tabs')).css('bottom');
angular.element(document.getElementsByClassName('has-tabs')).css('bottom','0px');
$scope.$apply();
});
window.addEventListener('native.keyboardhide', function (e) {
angular.element(document.getElementsByClassName('tab-nav')).removeClass('hide');
angular.element(document.getElementsByClassName('has-tabs')).css('bottom',bottom_stored);
$scope.$apply();
});
/* HACK */
this works
Reacted by Alexander Trakhimenok
Reacted by Ivan E. Sanchez and Bryan Arreola Murguía
Just simple add the following lines, so the android build in the AndroidManifest.xml have the adjustPan in android:windowSoftInputMode, this will cause that the keyboard overlays all the content instead of pushing the screen up.
Reacted by Lee Goddard
Reacted by Bryan Arreola Murguía, Christina and Constantin Radu
Reacted by Floyd1256, Jeremy Duran, Mart Dingley, Ivan Joel More Flores, thiagoceor, Bryan Arreola Murguía, Jamie, bigtourist, DavidGG1983, Jeroen Klarenbeek and 7 more
Reacted by Daniel Fast, belayan, hasansenturk, Raul Alvarez, John Clifford de Vera and Eduard Jusufi
Reacted by DavidGG1983 and Christian Pecson
Reacted by Nicolas, DavidGG1983, Christian Pecson and Franco Del Sancio
I gave it this way in Ionic V3. Works perfectly fine. TS file
ionViewDidEnter() {
if (this.keyboard.isOpen())
this.showTabs = false;
else
this.showTabs = true;
}
As of today.. with Ionic v
I could not get @ionic-native/keyboard to work. As many others stated.. onKeyboardShow() event never fires.
also cordova-keyboard-plugin has been deprecated.
At first at worked for me. When I first click on an input when the keyboard is shown the tabbar was hidden. After I click on another input the tabbar has showed again. So in my case the tabbar only been hided when I click on input field at first.
Hey everyone, while it's not the same as "hiding" the tab bar, this solution worked well for me by allowing the keyboard to obscure the tab bar instead of pushing it up.
In your main config.xml, edit the android platform to include the following:
What this does is modify the default value that Cordova writes to your AndroidManifest.xml to control the global keyboard input behavior for your app.
...and if you check AndroidManifest.xml on your next build you'll see that the default of android:windowSoftInputMode="adjustResize" is changed to "adjustPan", thus allowing the tab bar to be obscured.
@codymbeardsley Thank you so much! This solution work for me; at least for android it is a good solution. When the Keyboard is open, instead of pushing the toolbar, the keyboard just hide the footer!
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
mpaland commentedon Jun 25, 2016
Yeah, I assume you're under Android. The old keyboard problem...
I saw a talk on PhoneGap conf of @tlancina about the keyboard and it seems to be a pretty hard issue in general!
I can confirm that the bottom tab bar is pushed up upon opening the keyboard in my app under Android, too. But much more worse is covering input fields which are near the bottom. Tim said, one should try to avoid that, but unfortunately there are long lists to edit in my project.
I have postponed the whole keyboard topic to wait and see how it plays out in ionic.
Besides, @tlancina, is there a best practice tutorial about using the keyboard in ionic (integrating the ionic keyboard plugin, init/setting event handlers)?
tlaverdure commentedon Jul 14, 2016
I am experiencing this issue as well.
masimplo commentedon Jul 19, 2016
We are having the same issue in our project too. Any plans regarding this?
covveadmin commentedon Jul 28, 2016
Hey guys, also feeling the pain - any news by any chance?
theromis commentedon Aug 12, 2016
also need this great feature, tabs and may be even header nice to be able to hide.
masimplo commentedon Aug 12, 2016
@jgw96 I noticed you added the enhancement label on this. Since native apps do no behave the same (moving tabs above the keyboard) and the tabs are also limit the actual content real estate to just a couple lines, especially on smaller phones, shouldn't this be consider a more serious issue?
bvx89 commentedon Sep 2, 2016
For people looking for a temporary solution, here's what I did:
TabsComponent constructor:
Inside the CSS:
This won't work if you have multiple tabs on a page, but I guess you can select them with your CSS directly.
I'm currently running Ionic beta 11
RaymondAtivie commentedon Oct 7, 2016
any update on this?
RaymondAtivie commentedon Oct 7, 2016
@bvx89 Thanks.
For the sake of those on
Rc0there's a slight change on the cssNo official solution yet tho
jeanbaptistevilain commentedon Nov 27, 2016
Just to mention that enabling Fullscreen mode on Android also fixes this issue for me.
This can be done by setting
<preference name="Fullscreen" value="true" />in config.xml, and optionally adding cordova-plugin-fullscreen if you're using a cordova android platform older than v5.0.0.
masimplo commentedon Nov 27, 2016
Is this going to be fixed in the next version along with the rest of keyboard issues that are going to be fixed (read something stating that about keyboard issues in another thread) or has this fallen between the cracks?
39 remaining items
RicardoBer commentedon Sep 13, 2017
I do not have courage to go more than ionic v1.
I make this patch (I put in a the controller of affected view, as I only have one with this combo).
/* HACK Al mostrar el teclado el tabbar se pone encima de él en android*/
var bottom_stored=0;
window.addEventListener('native.keyboardshow', function (e) {
angular.element(document.getElementsByClassName('tab-nav')).addClass('hide');
bottom_stored = angular.element(document.getElementsByClassName('has-tabs')).css('bottom');
angular.element(document.getElementsByClassName('has-tabs')).css('bottom','0px');
$scope.$apply();
});
window.addEventListener('native.keyboardhide', function (e) {
angular.element(document.getElementsByClassName('tab-nav')).removeClass('hide');
angular.element(document.getElementsByClassName('has-tabs')).css('bottom',bottom_stored);
$scope.$apply();
});
/* HACK */
this works
Jatapiaro commentedon Sep 29, 2017
In my case this only happens when I'm using android, the best solution is change a property on the android tag in config.xml
<platform name="android"> <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application/activity"> <activity android:windowSoftInputMode="adjustPan" /> </edit-config>Just simple add the following lines, so the android build in the AndroidManifest.xml have the adjustPan in android:windowSoftInputMode, this will cause that the keyboard overlays all the content instead of pushing the screen up.
pablogarciamiranda commentedon Nov 29, 2017
For the approach of @Jatapiaro explained above, I have installed the following cordova plugin:
cordova plugin add cordova-custom-configThen I have just added the following to my config.xml
Working on Android & iOS
martingitehi commentedon Dec 15, 2017
Here is what I did to hide keyboard dynamically:
in my TS file:
then in my HTML file, I make a template variable called #footer which is what I am referencing in the TS above like this:
I hope it works for you too :-) @RaymondAtivie
abishekg commentedon Jun 5, 2018
I gave it this way in Ionic V3. Works perfectly fine.
TS file
ionViewDidEnter() {
if (this.keyboard.isOpen())
this.showTabs = false;
else
this.showTabs = true;
}
HTML file
<ion-tabs *ngIf="showTabs" #myTabs>
senturkhasan commentedon Jun 5, 2018
senturkhasan commentedon Jun 5, 2018
not true answer
jayzyaj commentedon Jun 26, 2018
Is there any update on the official solution for this?
dharapvj commentedon Jun 27, 2018
As of today.. with Ionic v
I could not get @ionic-native/keyboard to work. As many others stated.. onKeyboardShow() event never fires.
also cordova-keyboard-plugin has been deprecated.
So what worked for me was...
post this.. I added window.addEventListener as described in their readme
don't forget to remove the eventlistener in case you leave the tab page and come back to it again..
jayzyaj commentedon Jul 10, 2018
At first at worked for me. When I first click on an input when the keyboard is shown the tabbar was hidden. After I click on another input the tabbar has showed again. So in my case the tabbar only been hided when I click on input field at first.
Any suggestion? @dharapvj
codymbeardsley commentedon Jul 27, 2018
Hey everyone, while it's not the same as "hiding" the tab bar, this solution worked well for me by allowing the keyboard to obscure the tab bar instead of pushing it up.
In your main config.xml, edit the android platform to include the following:
What this does is modify the default value that Cordova writes to your AndroidManifest.xml to control the global keyboard input behavior for your app.
...and if you check AndroidManifest.xml on your next build you'll see that the default of android:windowSoftInputMode="adjustResize" is changed to "adjustPan", thus allowing the tab bar to be obscured.
Motoralfa commentedon Aug 3, 2018
@codymbeardsley Thank you so much! This solution work for me; at least for android it is a good solution. When the Keyboard is open, instead of pushing the toolbar, the keyboard just hide the footer!
robroy92 commentedon Aug 18, 2018
Works Perfect!
Thank you @codymbeardsley
ionitron-bot commentedon Sep 17, 2018
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.