Bootstrap modal issue on Safari/iOS/iPhone
I had the same problem these days and figured out, that safari on iOS is working differently to other browsers with respect to one thing. The modal window is not shown on safari but on many other browsers, when there is a href="#" missing.
not working on Safari/iOS but other browsers:
<li><a data-toggle="modal" data-target="#testModal">Modal</a></li>
working on Safari/iOS and other browsers:
<li><a href="#" data-toggle="modal" data-target="#testModal">Modal</a></li>
Screen zooms in when a Bootstrap modal is opened on iOS 9 Safari
The following code fixed the issue for me (and some other people -> see GitHub link):
body {
padding-right: 0px !important
}
.modal-open {
overflow-y: auto;
}
Source: https://github.com/jschr/bootstrap-modal/issues/64#issuecomment-55794181
Bootstrap modal pop up issue on Iphone
We fixed the issue by using position:absolute instead of position:fixed
Position fixed and absolute are somewhat similar in behavior. Both use x,y positioning in the view port and both are outside of the DOM document flow so other content is not affected by the placement of containers. Both require zIndex positioning to determine vertical priority in the view stack.
Position fixed keeps the element pinned at whatever position you set it to regardless of the scroll position of the browser. This makes sense in some scenarios where you actually want to scroll the entire page but leave content in place. The key to remember is to not use it when you build have your own scrollable content on the page.
It turns out in my case I don’t really need position:fixed because I manage the position and size of the container and toolbar headers and footers myself anyway. I know where everything is positioned and keep the content area effectively wedged in the middle of the statically sized elements. By way of CSS and media queries I can force the header to the top and the footer on the bottom using fixed sizes which means I can safely use position:absolute.
Unable to scroll Bootstrap modal in iphone safari if the screen is pinch zoomed
Make the page not zoomable and this will fix it:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
Also try:
body.modal-open {overflow: hidden;}
Related Topics
Must Bootstrap Container Elements Include Row Elements
CSS - Vertical Line Between Bullets in an Unordered List
Why Does Display: -Ms-Flex; -Ms-Justify-Content: Center; Not Work in Ie10
Linear-Gradient to Transparent Bug in Latest Safari
Xhtml/Css: How to Make Inner Div Get 100% Width Minus Another Div Width
Purpose of *:Before, *:After Rule Without Content Property
Does 'Position: Absolute' Conflict with Flexbox
How Is the "Greater Than" or ">" Character Used in CSS
Is There a CSS Selector for Element Without Any Class
How to Select All Elements Whose Id Starts and Ends with Specific Strings
Difference Between "-Webkit-Text-Fill-Color" and "Color"
Media Queries - Mobile VS Desktop Browser
Background-Attachment Fixed with Transform Not Working in Firefox
Why Don't CSS Filters Work on Svg Elements in Chrome
Custom Li List-Style with Font-Awesome Icon
Can CSS Choose a Different Default Font and Size Depending on Language