-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Header bar moves up behind statusbar or even completely out of the viewport when form field is focussed #932
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
Comments
Duplicate of #818 |
Thanks. We're working on these keyboard bugs for beta2. |
Do you have any lead on what might cause this? |
Here is a working demonstration of this problem: I just tested this via the "Getting Started" process using "Ionic, v1.0.0-beta.1". My Steps:
I then edited
Then:
Here is the result: As you can see, the keyboard pushes the form up into the status bar. |
Hey Justin, I believe the issue is that has Give that a shot and let me know if it helps. On Wed, Apr 2, 2014 at 4:34 PM, Justin Noel [email protected]:
|
Unfortunately, that didn't help. In the sample project, I added this to the "style.css":
That didn't work even though "style.css" is included after the Ionic CSS file. I also confirmed in Safari debug that the So, I then tried just body with no luck.
Next, I just updated the "ionic.css" file. This still did not work. I also thought you might have meant to make the header static; so I gave it a try. No luck with that either. |
Ah didn't see it is iOS 7.1 only. I don't have access to a Mac right now so I'll take a look first thing tomorrow. Thanks for your help looking into this. |
Thanks for the working demo Justin 👍 |
Depending on your setup, setting In custom mobile web apps i have built, the header needs to be outside of any of these heavily position elements and the header itself set to Cordova also has an preference called "KeyboardShrinksView" which is defaulted to false. I havent looked at this yet but it looks like a solution for iOS to what Android already does with adjust-resize Creating a harmony between both of these differences is one HELL of a job |
We're actively working on keyboard fixes now to stop all of these problems. |
This bug is unfortunately not fixed in nightly 1717. |
One thing that @tlancina noticed is that with the latest tap fixes, if you click the input directly it does not move the header up. So I think we solved part of this issue. However, if you tap the label that wraps an input, then 300ms later it will do the ugly native scroll. The way the default Ionic css works it's hard to tell the difference between the wrapping label and the actual input, so this might be part of the reason it doesn't always work. I've been using this test page to help debug these issues on each device. Right now I think the reason is because we're not preventing the default on a label click. If we do e.preventDefault() on a label wrapping an input then the keyboard will not automatically popup on the first tap. I'll looking into this more, thanks. |
@adamdbradley volunteering as another tester for this fix when it gets into the nightlies. thx. |
Unfortunately this issue is not yet resolved in 1.0.0 beta2. |
@CoenWarmer We're aware of the issues and still working on it. Also, keep in mind that when reporting any keyboard issues please provide the platform, platform version, and is the issue in the mobile browser, emulator, or in cordova, and if it's cordova, is it full screen or not. Other useful information includes the element you tapped, such as the label or the input, did you have to manually scroll at any time to get to an input, does the meta viewport have height=device-height or not, and if the element is below where the virtual keyboard would eventually show, is it half showing where the keyboard would show, or is it above and no need to scroll. Thanks |
Encountered on:
Also happens on Android 4.4 and 4.3, also using 1.0.0 beta2. Exact same circumstances as iOS7.1. So when input field gets focus and keyboard pops up, nothing is wrong, it is when the input gets focus and you then place your finger on the input field and start dragging it up or down that's when you can move all content out of the view. Will make a screencast later. |
Screencast: https://www.dropbox.com/s/2g6b41n3s3vpj0s/2.mov |
@zelphir Can you please provide a codepen that replicates this issue? Are they both iOS 7.0, or 7.1? |
@CoenWarmer is your input in a content area by chance? The only way I am able to replicate your issue is by having an input that isn't in a scroll view. Just to clarify - this is expected behavior if you aren't using a scroll view. If there are inputs below the keyboard, and you are unable to scroll to them using JS, then the browser is forced to shift the content up for them to be visible, which is why you are able to move everything upwards. |
@tlancina My input is not within a content area. This is the code I'm using:
I'm not sure I entirely follow what you're saying about this being the expected behavior. Right now it looks like the app is breaking when everything scrolls under the header. Should I instead place the input field within an ion-content? |
Well suppose you have a list of several inputs, reaching to the bottom of your page. If they are not within an area that can be scrolled to using Javascript, how can they be brought into view when the keyboard comes up? The only way is to use the native browser scrolling, which works by shifting the content - all of it, including the header. When an input or focusable area is within an ionic scroll view, we prevent the default scrolling and use Javascript to bring it into view, leaving the header in place. I am not an ui-router expert unfortunately, but try placing the ion-content around all of the content on the page and see if that helps. |
I understand now- but doesn't that lead to the undesirable visual effect of the whole nav-bar disappearing including the back button? More to the point in my use case, if I put the input field within a ion-content, how can I make sure they stay fixed at the top underneath the header bar in a way that transition animations work correctly on iOS and Android? |
@ravivit9 @mikehaas763 @ashleyrudland
from keyboard ios note it will works like a charm. |
can i set cordova.plugins.Keyboard.disableScroll(true) and still expect the view to scroll to my input? |
@michaelknoch as long as your input is within a scroll view (like ion-content) it should automatically scroll into view, unless you have called |
@michaelknoch i think you are asking keyboard-attach |
@LightZam but it only supports ion-footer bar and my input is in inside my content in ion-view @tlancina should i wrap my content with ionScroll? http://ionicframework.com/docs/api/directive/ionScroll/ |
@michaelknoch you shouldn't need to, as |
@tlancina I am facing this issue on if i keep "cordova.plugins.Keyboard.disableScroll(true)" header dont push out, but keyboard comes on top of my textarea. and i kept the textarea (using with msd-elastic) inside , to get a similar style like whatsapp, so its outside ion-content and if i use keyboard-attach then it screws up with msd-elastic :( tried with ionic.Platform.fullScreen() evrything was fine in andorid. |
I am having the almost same issue after upgrading Cordova to 6.0.0, namely, statusbar appears and overlapps the Header bar when form field is focussed. This problems exists on my android device. I have not tried iOS device yet. Can anyone pls help? Cordova CLI: 6.0.0 |
I was having this problem on Android after upgrading to Cordova 6.0.0 and solved it by calling the AndroidFullScreen.immersiveMode method of the plugin https://github.com/mesmotronic/cordova-plugin-fullscreen // Hide system UI and keep it hidden (Android 4.4+ only) |
This problem is still happening, solving it by going full screen is not an appropriate solution since the app shouldn't really run on full screen, but just for the test I tried it, and while the app does go into fullscreen mode, it is still "larger" that the screen, therefore you can scroll it a little bit with the header going under the status bar ... |
Having this issue to? Is there a work around? |
Also having the same issue with iOS in Ionic 2 Environment As you can see there is not any room/padding between the status bar and the header in the Ionic app. |
New/old issue with the keyboard is here again. While I can disable scrolling when input is focused by taping, the old issue with the header scrolling out of view is again present if focusing form fields with the virtual keyboard special button. On Android keyboard there's a green button at the bottom right that allows to switch to the next input in the form. Even if I've got scrolling turned off the button scrolls the view to make focused inputs visible and as the result the header is out of the screen. To test this out the first input must be in the view and focused with keyboard visible and the second input must be below the fold (somewhere under the keyboard). Now tapping the green button (as in the picture) results in scrolling the view and the header goes off screen. Cordova 6.3.0 Do you have any ideas to turn off this button or fix the issue? I'm not 100% sure, but I suspect that this started after cordova upgrade to some 6+ version. |
@rafaellop Did you solve this issue? |
having this issue appear when file upload from Phone/Camera screen opens on iOS. |
I'm having this issue with the email composer Edit For those who are still having this issue even after trying everything, try reverting back to [email protected]. It seems as though 4.3 may have introduced some strange behavior. Even the most recent cordova-ios nightlies didn't seem to fix my problem but reverting fixed it right up. |
This issue is still happening for me as well, this is not resolved. |
In IOS,if we tap on statusbar whole ion-content will blinks in IONIC2.How to resolve this issue.Please suggest.. |
Reverting back to [email protected] didn't help me, sad to say. Same problem after using native camera file library. Just realized from another post I was able to downgrade the cordova-statusbar plug in from 2.2.1 to 2.2.0 and it fixed the problem. Seems like it was the statusbar plugin causing the problem in my case. |
I had this issue with
I had a textarea with |
Please use this plugin ionic cordova plugin add cordova-plugin-ionic-webview --save. Its solved my problem thanks |
I experienced the same problem in combination with the email-composer plugin. I solved the issue by upgrading the cordova-plugin-statusbar from version 2.2.1 to 2.3.0. |
@jvhe123 I just tried doing that but it looks like v2.3.0 does not exist, do you mean v2.2.3? |
I was having this issue for the iPhone X. Opening the keyboard pushed the header up and almost off the page. I fixed it by putting an eventListener in my javaScript file for the page affected:
This worked for me, hopefully it can work for one of you too. |
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. |
Well.. that about sums it up ^
Screenshot (Ionic beta 1, iPhone 4):
The text was updated successfully, but these errors were encountered: