Open johbor opened 10 years ago
I can confirm that this is an issue in jQuery Mobile and Safari for iOS8. I'm really interested if anyone has found a solution/hot fix for this. I can add that if you disable ajax (data-ajax=false) on the links in the list, the fixed footer and header will be displayed correctly.
I tried the same thing in PrimeFaces Mobile and then the list page with fixed header is rendered good. But the nice effects of the transitions are lost by this solution. And those transitions are what I like about jQuery Mobile.
In the code below you can see ajax="false"
<pm:header title="Details">
<h:form id="details-header-form">
<p:commandButton value="Back" action="pm:list" ajax="false" icon="ui-icon-arrow-l" styleClass="ui-btn-left ui-btn-inline" />
</h:form>
</pm:header>
@johbor I created a jsbin page per the contribution guidelines here: http://jsbin.com/bulivu/1/
and will attempt to reproduce. I don't have an iPhone but I'll test on the simulator. Based on your initial comment it sounds like it sometimes is a problem with the iOS simulator.
It looks like based on your copied code that your'e using jQM 1.4.4. Perhaps this was fixed with the latest version of jQM 1.4.5. I tested on an iOS 4s simulator running iOS 8.1 and wasn't able to reproduce. See this youtube video: https://www.youtube.com/watch?v=VsTS1vSmGGM&feature=youtube_gdata_player. Feel free to check out the jsbin code that I provided in the last comment to see if the code I'm testing is different from yours.
Update: Just tried again with 1.4.4 and I can't reproduce. I'm running inside an Apache Cordova application.
@johbor you can ignore my last messages. I tried from within Safari on the simulator and was able to reproduce.
Hello, I tried the code on http://jsbin.com/bulivu/1/ on the IPhone and on the simulator. I was able to reproduce the behavior. Actually it happens at a specific situation. Open safari in the iPhone Open the url http://jsbin.com/bulivu/1/ The list appears and the Safari address bar is still visible. Also the Safari bottom toolbar. Tap on a line the next page appears and tap on the back button and everything is ok. But then swipe the list up and the Safari address bar disappears and also the bottom toolbar of Safari. As soon as this has happened and then tapping on a line and on the next page tap on the back button the list appears but the fixed header renders too wide. This is what constantly happens in PrimeFaces Mobile. On the iPhone the bug is for sure reproducible with the code http://jsbin.com/bulivu/1/ if you move the list complete up and the address bar of Safari appears again and the bottom toolbar of Safari appears again, then tap on the last or another line and on the back button of the next page and the list appears again with a wrong header. You can see that the list is first drawn without header and the the header is drawn on top of the screen but too wide.
@johbor have you reproduced this outside the simulator i cannot reproduce on an iPhone 5s with iOS8.1
@johbor nevermind I just managed to do it
Step 1 on the iPhone 4s Swipe the list up and tap on a line
Step 2 Go back and the header is rendered too wide
On an iPhone 5 IOS 8.1 you have to swipe up completely until the bottom toolbar appears again in Safari and after that the bug is reproducible.
I believe this is the same issue that we were having, but with a footer instead. We discovered that using "minimal-ui=1" in a viewport meta tag resolved the issue (though, not the underlying cause).
<meta name="viewport" content="width=device-width, user-scalable=0, minimal-ui=1">
The "=1" might be unnecessary. I'm not the one who found this attribute, nor the one who implemented it. Check out the release notes for iOS 7.1 (search on page for "minimal-ui").
@0not Thanks for sharing! However this fix doesn't seem to work - at least not for me. The issue exists only in Safari for iOS 8, and not iOS 7, according to the tests i have made. It's a shame since i'm really interested in a fix. As of now i have disabled the transition on iPhones, as the only working solution i have found this far.
@rasneu Try getting rid of the initial and max scale in your viewport meta tag.
<meta name="viewport" content="width=device-width, user-scalable=no">
I made a jsbin here. It seems to work for me. At my company, we realized yesterday that minimal-ui might not have been what fixed it for us, but just the fact that we got rid of the initial and max scaling when we tested minimal-ui. Hope it works!
EDIT: If that viewport above doesn't work, try adding "minimal-ui=yes" (which is what we're sticking with):
<meta name="viewport" content="width=device-width, user-scalable=no, minimal-ui=yes">
<meta name="viewport" content="width=device-width, user-scalable=no">
The above configuration of the viewport helps. But then you introduce another problem. The second page is not rendered the right way. See the screen shot. This can also be solved to make the header also fixed for the second page. But then the normal smooth transitions are very ugly.
Looks like the issue is within the initial-scale or minimum-scale. By removing both of these in the meta viewport tag will fix the issue. Having the maximum-scale still in there appears to be ok and is needed for iPad and Desktops otherwise it renders the text too large.
Removing any data-transition=
appears to have mitigated the issue in my project. I was using 'slide' transitions but reproduced the problem with flip
. (update, flip
might be ok, still testing).
Somewhere between pagebeforeshow
and pageshow
the size of the fixed navbars
get changed to (on the iOS simulator) 427 when they should be 320.
For reference, this is on iOS8 in the simulator. The viewport meta tag is:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui=yes" />
Testing results:
fade: ok pop: ok flip: mixed results turn: ok flow: broken slidefade: ok slide: broken slideup: ok slidedown: ok
I have switched to slidefade
as it appears to work consistently and has a similar effect to slide
.
Got the same issue with slide transition on a iphone 5s. Anybody found a workaround?
There is a problem with rendering the fixed header in a page with a long(er) listview. When the first page is opened everything looks fine and the button is rendered in the header on the right side. Moving the list completely up and then tapping on the last line opens the second page witht e.g. details. Then tapping on the back button in the header of the detail page opens the list page again but then the header is wide. The button on the right side of the header is not visible anymore and the central text is shifted to the right. All things like a button bar or toolbar in the header will diplay wider when the header is wider then it should be.
This happens on the iPhone4s (IOS 8.1) as on the IOS simulator for all iPhones on the Mac. It happens NOT on the iPad (IOS 8.1) and also not for all iPads on the IOS simulator. It happens NOT on the Windows Phone. It happens NOT on Android. It happens NOT on the iPhone with the Chrome and Opera browser.
The remarkable difference between the iPhones and the iPad simulations is that pushing up the list causes Safari on the iPhones making the address bar disappear and only showing the ip address in text. And exactly when this happens it goes wrong with PrimeFaces Mobile.
I discovered this while using PrimeFaces Mobile (JSF) which uses JQuery Mobile. But there the bug is even worse. When the list page opens and after that tap on the first line and back, everything is ok. But as soon the list moves a little bit up, Safari lets disappear the address bar, and tapping on a random line in the list and back from the detail page the header width is too big and the right button is not visible anymore. So using the fixed header in combination with the list is a no go in PrimeFaces Mobile. I can only use the inline option.
I will give the JQuery Mobile page that I tested on the iPhone and the simulator.
The first 4 pictures are from the iPhone and picture 5,6,7 and 8 are from the IOS simulator.
Open the first page on the iPhone
Move the list completely up and tap on the last line
Tap on the back button to open the list page again
Now the header is too wide and the right button is gone and the center text is moved to the right
Open the first page in the IOS simulator
Move the list completely up and tap on the last line
Tap on the back button to open the list page again
Now the header is too wide and the right button is gone and the center text is moved to the right
Gr. Johan Borchers