-
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
Auto hide tabs when keyboard is open #7047
Comments
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! Besides, @tlancina, is there a best practice tutorial about using the keyboard in ionic (integrating the ionic keyboard plugin, init/setting event handlers)? |
I am experiencing this issue as well. |
We are having the same issue in our project too. Any plans regarding this? |
Hey guys, also feeling the pain - any news by any chance? |
also need this great feature, tabs and may be even header nice to be able to hide. |
@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? |
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 |
any update on this? |
@bvx89 Thanks.
No official solution yet tho |
Just to mention that enabling Fullscreen mode on Android also fixes this issue for me. |
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? |
@RaymondAtivie |
It's not working for me in RC3. |
+1, i have same issue. Cordova CLI: 6.3.1 |
I have this same issue, and the workaround posted by @RaymondAtivie isn't working quite right. the tabs are no longer visible, but there appears to be a top border still visible. Anyone else have this issue? I've tried adding |
I've solved this issue by turning
|
I've tried this and still have the same top border showing even though the tabbar is set to display false. |
@payneBrandon I'm hiding top bar |
this bar looks like a part of the form |
Finally figured it out. I didn't have to worry about a header since my tabs are on the bottom, BUT I did need to look to the footer (duh!). I applied a conditional class to the footer to hide it if the body has the keyboard-is-open class and BAM, back in business. Thanks for the help! |
@payneBrandon good luck |
Would like to see that feature as well. |
I have made a simple fix (of course not ideal). The
and then attach this class to
and add this to
I also hid the tabs when the keyboard is open using the same method in
I did this only for the page which I needed the fix. Working in both iOS and Android. |
SOLVED this a proper solution except css marked.
this my tabs.html
<ion-tabs *ngIf="valueforngif">
|
nice @efnan34 , though you shouldnt need to provide it in the constructor. |
+1 for an official fix! The "display:none" approaches cause unacceptable flickering, and the tabs render once then disappear...looks gross and hacky. (anybody have any ideas how to get rid of the flicker? I'm not above a hack if it looks good to the user) |
Anything new regarding this issue? still waiting for an official fix before I lose hope and start implementing something that would affect the quality of the UI |
@PatrickMcD, The Lord of The Thumbs Down, just wondering have you try to quit this habit? |
@viking2917 you could try the hack I suggested and try forcing the tabs height to zero. That might work. I haven't tried it yet though. |
Unfortunately hiding the tabs with CSS will cause a number of problems. Ionic calculates a few values such as margin on We've had to remove the solution because some positioning problems with other components occured. |
@Khalid-Nowaf I simply don't appreciate spam comments that sap time away from the Ionic team and away from the ~2000 watchers of this repo. @Floyd1256's comment is inconsiderate spam. It adds nothing to the conversation. It is just another "plus one / are we there yet" comment which only serves to fill our inboxes. My downvotes are attempts to nudge others toward more considerate behavior. Before commenting, we should remember that we are having a conversation with ~2000 people whose time is precious. We shouldn't treat this space as flippantly as we would a personal IM chat with friends. We should ask ourselves whether our comment will help or hinder others, whether it advances the conversation or is just noise, whether it is truly necessary to say or could better be voiced with a Github reaction, and whether it will accelerate or slow down development. |
There seems to be a branch addressing this issue along with some others https://github.com/ionic-team/ionic/tree/keyboard-fixes |
fixes ionic-team#9699 fixes ionic-team#11484 fixes ionic-team#11389 fixes ionic-team#11325 fixes ionic-team#11291 fixes ionic-team#10828 fixes ionic-team#11291 fixes ionic-team#10393 fixes ionic-team#10257 fixes ionic-team#9434 fixes ionic-team#8933 fixes ionic-team#7178 fixes ionic-team#7047 fixes ionic-team#10552 fixes ionic-team#10393 fixes ionic-team#10183 fixes ionic-team#10187
fixes ionic-team#9699 fixes ionic-team#11484 fixes ionic-team#11389 fixes ionic-team#11325 fixes ionic-team#11291 fixes ionic-team#10828 fixes ionic-team#11291 fixes ionic-team#10393 fixes ionic-team#10257 fixes ionic-team#9434 fixes ionic-team#8933 fixes ionic-team#7178 fixes ionic-team#7047 fixes ionic-team#10552 fixes ionic-team#10393 fixes ionic-team#10183 fixes ionic-team#10187 fixes ionic-team#10852 fixes ionic-team#11578
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*/ this works |
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
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. |
For the approach of @Jatapiaro explained above, I have installed the following cordova plugin:
Then I have just added the following to my config.xml
Working on Android & iOS |
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 |
I gave it this way in Ionic V3. Works perfectly fine. HTML file |
|
not true answer |
Is there any update on the official solution for this? |
As of today.. with Ionic v 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.. // MyTabs.ts
showListener() {
console.log('keyboard visible');
document.body.classList.add('keyboard-is-open');
}
hideListener() {
console.log('keyboard hides');
document.body.classList.remove('keyboard-is-open');
}
ionViewDidEnter() {
window.addEventListener('keyboardWillShow', this.showListener);
window.addEventListener('keyboardDidHide', this.hideListener);
}
ionViewWillLeave() {
window.removeEventListener('keyboardWillShow', this.showListener);
window.removeEventListener('keyboardDidHide', this.hideListener);
} |
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 |
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! |
Works Perfect! |
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. |
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:
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
The text was updated successfully, but these errors were encountered: