-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Header and footer change their position after keyboard popup - iOS #4113
Comments
We're facing the same issue. Any workarounds etc. available? Thanks |
Come on guys, nobody will answer that ? This bug shows that fixed toolbars are breaking the gui. |
@mletynski Thanks a lot for the jsfiddle. With which version of iOS are you experiencing this problem? Thanks, Anne |
@agcolom for iOS 5 and 5.1 |
@mletynski I cannot reproduce on the iPod Touch iOS 5.0.1 (do you only experience this on the iPad with iOS 5 and 5.1 or do you see this also on the iPhone/iPod Touch? I'll be able to test on the iPad simulator 5.x later this evening. I have also noticed that you don't have |
I didnt try to reproduce it on iphone or ipod. Im reproducing it on iPad with iOS 4/5 and on iPad simulator 5 and 5.1 My real example has: meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />" which unfortunetly does not make any difference ;/ |
@agcolom did you reproduce it ? I can also reproduce it on iPhone 5.1 simulator easly. Important thing here is that content need to be scrollable. |
@mletynski yes, I just managed to reproduce it on the iPad2 iOS5.1. We had a similar issue a while ago, but it got solved, so I need to check how we solved it then. |
This looks linked/similar to #1087 |
@agcolom thanks for the hint. I checked what was introduced there and "hideDuringFocus" was added. It is what we are looking for. Unfortunetly there is a "bug" there, in line 7305: "if( screen.width < 500 && It is is applied only for screen.width<500 ... I don't know why here is such condition ... but for our ipad it is 768 .. Look like easy fix ... |
@mletynski - Did changing that width threshold fix the issue for you? I think we added this logic because we hide toolbars on smartphones to leave more room for input and virtual keyboard. We figured that at tablet sizes (>500px), there would be enough space to comfortably view the toolbars + input + keyboard so it might look ood to have the toolbars hiding and showin focus/blur. |
@toddparker - Yes it works for me after increasing this width threshold. |
@mletynski When you do this, don't the toolbars hide on focus? Do yo think that feels odd? |
@toddparker Yes they are flickering. But i changed this code a little bit (i removed animated part), so the show and hide are invoked immediately and everythink works perfectly for me. |
@toddparker will it be fixed in in new jquery mobile version ? |
@mletynski Do you have a test page I could review with the suggested changes you made? |
@toddparker |
Ah now i read your previous post, sorry i was lost with multiply of those issues ... If the original code is hiding toolbars for smartphones after changing this threshold it does hide it for ipad very random ... Sometimes they are hidden, but sometimes not. Maybe its again connected somehow with scrolling issue ... |
@toddparker |
Regarding the original issue. Do you see any improvement when you look at http://jsbin.com/otepum/100/ which loads latest code? |
@uGoMobi No, the problem still exists. Footer jumps to middle of the page. |
@uGoMobi I also still have this issue with 1.1.1-rc.1. //Edit new work around for my instance: |
I am facing a problem regarding footer jumping to middle of screen when opening keypad on any field.This problem is occured only in Iphone 4.This application is developed using asp.net.Please give any suggestion... |
Still an issue in iOS6 with JQM 1.2.0. |
I have this issue on my iPhone. Would it be possible to add a flag so the footer will hide but the header won't? This will make it easier for users to press the 'Save' button that we place in the header while an element is still selected. |
This appears to be a bug in mobile safari not the fixed header and footers set up a test case not using jqm at all with exact same results http://jsfiddle.net/arschmitz/rSGPA/16/show it seems like when the keyboard pops the viewport is moved and not scrolled to center the input. the fixed header/footer are still positioned at 0 top / bottom after scroll i put some scales to demonstrate |
… after scroll and repositioning logic. Fixed: jquery-archive#4337 - Fixed header problem after scrolling content on iOS and Android, jquery-archive#4113 - Header and footer change their position after keyboard popup - iOS, jquery-archive#4724 - Moving through form in Mobile Safari with "Next" and "Previous" system controls causes fixed position, tap-toggle false Header to reveal itself
Am having the same issue, and I have tried all the ways to keep the header in it positions when keyboard popup but nothing worked for me. also I have tried some OBJ C code and it worked perfectly it stoped the repositioning in IOS UIWEBVIEW when keyboard popup. But this OBJ C solution did not work with long form in case you have one filed it might help.
then add these two function anywhere in mainviewcontoler.m
|
Hadi's fix above does make it a bit better - there is quite a flicker when the keyboard goes away though. |
Hey guys I have managed to solve the issue I will provide you with the solution after the weekend (: A brief of what I did .. I get rid of Iscroll plugin I did some code changes on Cordova ViewControler class. Also I have added some Objective C code to stop pushing the uiwebview when keyboard opens and to call a Java script function when keyboard is open. This java script function re adjust the height of the HTML page after keyboard is up. |
I will explain how I have solved this issue. Objective-C: 1- In (void)viewDidLoad function 2- Comment the whole - (void)keyboardWillShow:(NSNotification*)notif function: //- (void)keyboardWillShow:(NSNotification*)notif //}
} 4- In MainViewController.m 4.1 in function - (id)init add the following at the end: 4.2 add the following function in MainViewController.m
self.webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); }
} 5 - My config.xml have the following 6 - In css I have the following for header, page and content:
.ui-page {
.ui-content {
7- JS functions: $(document).on('touchstart', 'input, textarea, select', function(e) {
}); $(document).on('touchend', 'input, textarea, select', function(e) {
}); $(document).on('focus', 'input, textarea, select', function(e) {
}); function needsFocus (type) { switch (type) {
default: function keyboardShow(keyboardheight){
}
} function active_scroll(el,height){
} function scroll_to(keyboardheight){
} 8 - in jquery.mobile-1.3.2.js Finally this is it, and sorry for this a lot of code and my bad English ): I hop you guys can get any benefit from it . Note: that app am doing is Portrait no Landscape I have not test it in Landscape. |
Same problem here. Drove me crazy. Nothing helped and I cannot change anything in the app. I solved it with this dirty trick: $("input, select, textarea").bind("focus",function() { (Of course my footer-DIV has the id="thefooter") Works like a charm - and the trick is nearly invisible because the footer would be under the keyboard anyhow and isn't accessable for the user. |
Hey There This will fix all
they key being "target-densityDpi=device-dpi" - enjoy |
@neilbaylorrulez - Thanks a lot! We will test that. |
no worries, definitely works in ios7 for my non jQuery mobile project - so i probably shouldnt have been so definitive. Another viewport meta attribute to play with is: height=device-height As an aside, you guys should consider also putting "minimal-ui" into the default meta viewport tag - this will tell ios7 (ios7.1 to be specific, but hopefully other user agents too) to hide the address bar and other browser chrome for a full-screen app |
The viewport key suggestions by @neilbaylorrulez don't work for me, unfortunately.. |
Thanks neil! the viewport target density did the trick for me! |
^ Not for long (and not on iOS): http://www.petelepage.com/blog/2013/02/viewport-target-densitydpi-support-is-being-deprecated/ http://trac.webkit.org/changeset/119527
|
啊啊啊啊,it seems that this issue was still not fixed?i face this issue too.悲催~ |
I encountered this issue in a Cordova app using JQM 1.4.5 with iScroll 5.1.3 testing on iOS 8.3 When the virtual keyboard is shown, scrolling the page using the iScroll widget causes the fixed footer to become unfixed and obscure the content. The |
Put this in the header tag
should do the trick. |
@Chener thank you very much.yours did the trick for me |
Have this problem with a header. Implemented: but unfortunately it's still not 100% solved. When I'm in one input field with keyboard active and click in another one, the header usually moves down ~100px |
@elsewhat that is just how ios works there is not such thing as fixed position with the keyboard is open. any scrolling while the key board is open will cause any fixed position element to scroll with the page. |
@arschmitz agree fully that this ought to be fixed in iOS. Instead of solving it at the root, we have to monkey around finding weird workaround |
@elsewhat there is a workaround you need to force layout anytime there is a scroll which will cause them to update but this is very bad for performance |
var _originalSize = |
lakinmohapatra, did you try that solution on iOS? Unless something has changed in recent Mobile Safari versions, it does not change the size of window when the keyboard is shown. But what does it solve? Not the subject of this Issue! Is it meant as a partial solution - e.g. how to determine if the keyboard is shown?
Your solution for determining if keyboard shown would work for Android. But this is about iOS. AFAIK, still, the only way to do that is the way hadi77makkaw showed for Cordova - using native code. I've also used native code in a different hybrid development environment (Rhomobile). I don't know of a way to do it for Mobile Safari itself, as then you can't use native code. So, seems only solvable if using a UIWebView or WKWebView rather than system browser. |
Header and footer change their position after keyboard popup - iOS
Issue will be resolve for header. |
When the content of page does not suit whole screen and we need to scroll, we have a problem with header and footer position.
Just open this link from safari ipad simulator:
http://jsfiddle.net/6ghtb/4/show/
Just click on input number 10 (last one which is visible before scrolling) and observe footer. It just jump and leave space between himself and the keyboard ...
When you scroll down and click most upper input, you have the same problem with header.
screenshot:
https://www.evernote.com/shard/s194/sh/c801a939-06a7-47cc-a3b8-70bb03af0ca1/30f7d6eb650566bfe6032f634b0381e5
The text was updated successfully, but these errors were encountered: