-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Modal disappears in iOS #4860
Comments
I have a similar (if not identical) issue in the Android 4.0.4 stock browser, where the modal backdrop fades in but there is no modal. However, if I touch anywhere on the screen it appears. I don't get any flicker but it may just be a difference in the rendering behaviour between the iOS and Android browsers. |
I think I found the problem.
So the top:auto is the problem |
Just adding a confirmation that the issue is the responsive bootstrap's media query that sets .modal.fade.in { top: auto }. I fixed this issue in my own project by overriding with my own media query: @media (max-width: 767px) { Now on mobile devices the modal animates in and stops at the top of the screen. |
This did not fix the issue at hand. With
the modal was at least vertically centered. But the calculation of the margin-left seems to be off as it is partly outside of the browsers window. |
@aurril Is your modal HTML inside of grid-based code? I've noticed that Bootstrap's responsive CSS ends up a bit funky with fluid grids and offsets. I'd had a similar issue at one point with modals appearing not horizontally centered, and determined that it was due to the parent elements' classes. Try setting up an area outside of the rest of your DOM to place the HTML and see if it still causes problems. |
It is not inside a fluid grid. But the parent is the static grids container div. |
@aurril I would suggest removing the initial You can get a better idea of what is causing it to be misaligned by resizing your browser more narrow than 767px and then using something like Chrome's Web Inspector to examine it. It's very likely that the responsive css is the source of the misalignment. |
@kromem That would most likely be just a temporary workaround. Fact is that the code to calculate the margin-left has a bug that needs to be fixed. This afternoon I will try to place the modal inside the body and see if it works around the issue at hand. |
@aurril Mis-typed...I mean without a parent other than body (fixed in edit). And yes, there are actually a fair number of design choices (more polite way of saying "weirdness"?) with the bootstrap-responsive.css. On my project I've had to overwrite a fair number of the rules. Much of the strange behavior seems (after reading through official responses to bugs here and there) to relate to a desire by the Bootstrap team to support legacy mobile browsers that didn't correctly handle things like So it's possible that the way responsive views handles offsets is a bug, or it might be a workaround that doesn't behave well when the |
@aurril with "top: 50%" you will have problems if you have a large modal size. I have no issues with margin-left, do you have the same behavior with bootstrap docs? I had fixed the issue with this: @media (max-width: 767px) {
div.modal { // Added more weight to the selector to override
&.fade { top: -100px; }
&.fade.in { top: 20px; }
}
} |
@andreabreu98 I'm using the modal to display images in a gallery like fashion. In the docs the modal body has a fixed height of 400px, which I do not have. Using "top: 5%" the modal is partly invisible as it is too high. |
This was originally filed as bug number 4658 but was summarily closed because they didn't provide a fiddle. IMHO no fiddle should be necessary when you can reproduce it on bootstrap's homepage. |
It might sound like a no brainier but keep in mind they have the rules to make it easier for us, contributers to contribute and for them, fat and mdo, easier to maintain the most popular open source project in the world. The easiest thing you can do is just submitting a pull request. There is fix above in the comments. Sent from my frank phone, mhm On Monday 17 September 2012 at 18:33, Josh wrote:
|
Hey @torstah, Thanks for opening this issue! Unfortunately, it looks like it fails to pass the criteria neccessary for submitting to bootstrap. The following things are currently failing:
For a full list of issue filing guidelines, please refer to the bootstrap issue filing guidelines. thanks! |
Hey @malandrew This issue is not possible to reproduce with jsfiddle, because jsfiddle overides how modals are behaving since you are not running in a full browser window. Go to http://twitter.github.com/bootstrap/javascript.html#modals |
So I don't know how to do a JSFiddle for this but the same issue can be recreated here: http://twitter.github.com/bootstrap/javascript.html#modals
If I try the live demo button, the modal appears and then goeas away. The background is still "faded" or dimmed, the modal can be seen a flickering in but then is gone. It can't be found by scrolling to the bottom or top of the page either...
I have this issue on a iPhone 4s, iOS 5.1
Anyone else have the same problem?
Thanks
/T
The text was updated successfully, but these errors were encountered: