-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
iOS 8.x modal scroll issue #14839
Comments
Does this happen with the "Live demo" modal on http://getbootstrap.com/javascript/#modals ? |
The "Live demo" modal does not demonstrate the problem, and that may be because of the fairly simple markup contained in there. I would post a live example of the problem but mine is fairly complex and could make it hard to determine the issue, I will try and throw together a simpler example that demonstrates the issue and post it. |
Closing until we hear more with a reduced live example. Just ping us here and we can re-open. |
I've encountered this on the following page: It pops open a modal with a contact form on it. It seems like the scrolling issue happens specifically after validation. |
@vigilanteweb Could you please reduce that to a minimal JS Bin? |
Here is a link to a JS Bin with the appropriate code in it. http://jsbin.com/riyejibaba/1/ |
Hi @vigilanteweb! You appear to have posted a live example (http://jsbin.com/riyejibaba/1/edit), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
@vigilanteweb Please further reduce the amount of irrelevant code in the Bin. Thanks! |
Here it is. http://jsbin.com/yimugaxaho/1/ |
Hi @vigilanteweb! You appear to have posted a live example (http://jsbin.com/yimugaxaho/1/edit), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
@vigilanteweb -- does it happen with this fork http://jsbin.com/kiwela/1 |
Hi @carasmo! You appear to have posted a live example (http://jsbin.com/kiwela/1/edit), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
@carasmo Yes it does. IT appears that there isn't any validation in that fork, but it does still have the scroll issue. |
Hello, I'm new to this, but I am having a scrolling issue as well. On IOS8 with a simple modal with an image and content. Here is a working example. If you click on some of the longer images you'll notice the issue: http://designinspiration.com/ |
I can repro on http://getbootstrap.com/javascript/#modals with iOS 8.1. |
i had the same issue after focusing on any input/textarea element in modal. try to remove '-webkit-overflow-scrolling: touch' property for '.modal'. it helped me to solve the problem. |
+1 removing |
Really excellent fix! |
I haven't seen someone pointed out that you can't scroll pass the modal footer buttons, it's impossible to click it because bounces back when you scroll. |
I created a new version with the fix I simplified by removing the transitions. |
The fix I've settled on is the position:fixed, width:100% on the modal-open class, plus using javascript to set the top css style on the body (so scroll position does not appear to change) and then scrolling to that "top" when the modal is closed. This is what that looks like with the react modal I'm using. It appears to work pretty well.
I also had to make a change to force a repaint after the modal is displayed and disable animation in Safari because of a bug with a modal nested in a table cell not being drawn correctly.. |
It is more than one year now and we do not have solution yet. Anyone maybe succeeded ? |
I solved it. The problem is with the overflow and position. If you want that is going to work perfect in Safari (apple devices) you have to do next things: .modal { So, in case if i forgot anything from there, I recommend to check if most of elements inside modal window are static. I hope it is going to help you. |
I have tried different solutions and ended up with removing the: Attention...if you use the following code then links in the modal to anchors (same page) doesnt work on some devices (iphone 4, ipad mini, ipad air): @media only screen and (max-device-width:768px){ body.modal-open { body.viewport-lg { body { |
This worked for me:
|
Thanks @comapedrosa !! |
The fix from @comapedrosa is working for me on iOS 9.x with the iPhone 6S. |
I fixed this for UI Kit using the following CSS. Basically a combination of some of the fixes above. @media only screen and (max-device-width:768px) { This might work on Bootstrap too if you change some of the classes. |
This issue seems to muddle together what might be multiple similar but separate underlying bugs, but anyway, filed a relevant WebKit/Safari bug: https://bugs.webkit.org/show_bug.cgi?id=153852 |
Add Wall of Browser Bugs entry for https://webkit.org/b/153852 Refs http://getbootstrap.com/getting-started/#overflow-and-scrolling Refs #14839 [skip sauce]
Also filed a separate bug for the "scrolling starting within a text field scrolls the WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=153856 |
Worked for me @comapedrosa Thank you |
I solved it (I hope!) with jquery. When the modal is "visible" I've settled the HTML and BODY height as the windows screen size and overflow: hidden: |
@castiweb not working for me! issue still persists! and it also affects Sticky Footer on responsive websites. |
@happy2deepak I think you're right! Maybe the best way is the css rule to subscibe bootstrap declaration: |
@castiweb yeah! Thanks. this works for me to an extent ! Though I will need to handle my Sticky Footer manually, but for time-being i can enter input values and scroll on the iOS devices |
This fixed it for me on iPhone 4s and above
|
Add Wall of Browser Bugs entry for https://webkit.org/b/153856 Refs #14839 (comment) [ci skip]
Modal scrolling appears to be broken in iOS 8, but only in some cases. If I fill a modal with something simple like a bunch of text in paragraph tags it can handle it, but anything else like a grid stops scrolling and the background page scrolls. The same content in iOS 7 no problems. Wondering if the issue is known and if there is any kind of workaround I am stumped.
The text was updated successfully, but these errors were encountered: