Twitter bootstrap modal leaves screen unclickable after it disappears - ios

I tried to use the modal feature of the twitter bootstrap framework with iOS5.
After the user clicks on the close button, the modal disappears correctly, but no other item of the screen seems to be clickable. This behaviour just occurs under iOS5.
It's working correctly with iOS 6 and in any desktop browser.
Here the close button:
<a type="button" class="close" data-dismiss="modal" aria-hidden="true">×</a>
May this occur because of the missing html5/css3 support in iOS5?

mr Liam say true: the modal box will also bring up a background overlay which prevents touches outside the background view.
Yor may catch it in debug and write your own js to close it when button clicked.
Like $('.your_class').hide()
Also take attention that this problem may occurred when you open modal window and leave the page. If you click 'back' on device, you may see same problem

I know this is a very old topic, but I thought I would post the solution anyways as this is still a problem with bootstrap v. 3.2.0. It is only an iOS 5.0.0 to 5.1.1 problem.
The problem is to do with the buggy implementation of -webkit-overflow-scrolling on iOS 5.
I simply added an ios5 class through JavaScript to html (by user agent detection, though not the best approach either). Then you can use the following and it will fix the problem.
.ios5 .modal {
-webkit-overflow-scrolling: auto;
}

Related

IOS native keyboard pushing entire webview up - cordova app

I am developing an app (IOS platform) using HTML5, CSS3, angular and cordova(3.8) and stuck with an major issue.
I have a page with footer having three buttons. On click of each button a modal comes up from the bottom. Modal position is set to fixed and inside it as scroll-able container. scroll-able container contains a text area where user can input some text.
Whenever the modal comes up, text area is focused so that keyboard comes up by default. The issue is whenever native keyboard comes up webview is pushed up and entire modal gets scrolled.
I saw same issues been posted by others and I tried few solutions mentioned in reply for those questions like using ionic keyboard plugin, setting scrollTop to 0 on textarea focus. But nothing worked out.
In config.xml, I have set DisallowOverscroll to true.
It would be great helpful if someone help me with this issue ?

CSS Menu system not working in IOS 8

I implemented this css dropdown menu system a few years ago and I am just realizing now that it does not work on my iPhone, yet it works fine on my bosses android phone. I was under the impression that since IOS5, i-devices do register a touch event as a hover automatically but I guess I was wrong.
The structure of this menu is a little weird in that the main tabs (other than Home and Contact) are not meant to take the user anywhere, only the submenu items actually go to another page. I have a feeling this is where the issue may lie, but I can't figure it out.
Here is a JS Fiddle.
The :hover is on <li> to cause the dropdown. Maybe this is the issue? or maybe its the way my boss coded the button so it would look like a link but not do anything on a click:
<li id="aboutus" class="blogbutton"><a><span>About Us</span></a>
I tried removing the anchor tags and the whole button goes away. I removed the span tags and the original problem still remains.
Is there a fix without having to rewrite the whole menu system?
Try adding an onclick="return True;" attribute to the base menu that triggers the drop-down. Safari will trigger the hover attributes, but only if it thinks that the element does something when it's tapped, and for a static element like a li, this is the easiest way to achieve that.

Manually Show/Hide Device keyboard in JavaScript

Can I manually show/hide device keyboard?
My application is behaving strangely if device keyboard is on display and, say, I hit next button then the CSS of jQuery Mobile is getting distorted. I am not getting any javascript or any other error in the console. Any help is appreciated.
I have used one of the suggestions in the following question (the one with 84 up votes...), and it worked well for me: iPad Safari - Make keyboard disappear
Lets assume you have an <input type="text" id="myInput" />.
So in your change page code you can do the following, which will first dismiss the keyboard and then perform the page navigation:
function changeToPage1() {
$("#myInput").blur();
$(':mobile-pagecontainer').pagecontainer('change','page1.html');
}
Tested in iOS Simulator but should work in Android as well.

UIWebView hiding keyboard margin

I'm building an iOS wrapper application for a web page, which was built using Bootstrap, at the top of my web app is a .navbar div, not fixed or anything and displays perfectly on first load.
The problem starts when I touch an input, type and then hide the keyboard. Once the keyboard has hidden the page has been moved back down, but the navbar is nowhere to be seen.
It turns out this was caused by a bug in the CSS code which gave a margin to the body. The simplest way to fix this was to change the CSS. Although I'm still none-the-wiser as to how control the UIWebView in such situations.

Has anyone experienced one form element activating another on iOS / iPhone?

I have a form that appears in a FancyBox iframe modal. On iOS 5 (specifically on an iPhone - does not occur on iPad) when I touch the submit button it activates a <select> that appears about 50 pixels above the submit button and I'm then presented with the <select> options at the bottom of the screen.
I've zoomed in as much as possible to verify that I'm not touching the select – I am indeed clicking on the submit button and it highlights itself as expected, but the form of course does not submit and I get the options to pick from.
Has anyone experienced a bug like this in iOS 5? I can't pin this down to anything else – there is some javascript that would normally run to process the form on submit click but it's not being activated at all and it has no effect on the form itself, the <select>, etc. I have seen several odd things with iframes on iOS and wonder if there is a potential correlation.
You might have the connections for your actions going to different buttons than the outlets. That would explain why the right thing would happen (Action is OK) but updating the Frame Rect would get messed up (Outlet is on the wrong button).
iframes on ios don't behave like normal iframes in every other browser (including desktop safari).
ios safari renders them at the full height of the page inside the iframe.
To get them to scroll like a normal iframe of fixed height you have to put them in a div and set the divs overflow to auto or scroll. I'm guessing your modal overlay is already doing that.
But even a plain in-page iframe with no special positioning (other than using a parent div to crop its height and make it scrollable) will often only have the submit button work 1 time if the submit buttons original rendered location was below the fold of the parent div.
So the first submission will work, but if the form comes back with missing required field errors you can't hit the submit button again.
Further research on my old ipad shows that if the submit button is down far enough it won't even work that first time.
The bug is present in safari for ios 5.1.1 and also ios 8 !!!
I can use an onclick javascript function on any element in the iframe that is not an input type=submit to force the form to form.submit().
But specifically about the iphone issue what was probably happening was that the OS was trying to zoom in to the form field so the use could clearly see what they were typing. The fix for that might be to declare a font-size of at least 16px on input elements. That way the OS knows the text in the field is already at a fairly readable size and won't try to zoom in. Zooming in to the contents of an iframe within an absolutely positioned modal overlay is super buggy even in ios 8.

Resources