-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Mobile modal scroll issues (Beta 2) #24737
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
Comments
Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via CodePen or JS Bin and report back with your link, Bootstrap version, and specific browser and OS details. |
Can't reproduce it on CodePen or JS Bin. MAybe of a used parallax effect. |
Can you juste create a CodePen with your HTML markup to allow us to reproduce your bug |
Sorry, I've just tried to reproduce it on CodePen, but I failed. |
I made a CodePen for you : https://codepen.io/Johann-S/pen/eegRqe |
We never fixed this in v3, and I don't think we've fully done it for v4, but I think this is generally a won't fix given the state of fixed position and scroll/touch keyboard bugs in iOS. Thoughts, @twbs/team? |
Just a note: on Firefox 57, the background still scrolls in the live example but not in the pen. EDIT: |
@twbs/team Why not using the shinny and non-standard @Johann-S I've added more text and a scale meta tag to your pen and an I could only tested it on iOS Safari and it works. Are you guys able to test it on other mobile browsers? I know it's non-standard, but if we can test it enough and prove that adding it doesn't hurt other browsers we should be ok. Here is the normal pen: https://codepen.io/andresgalante/pen/MOpbrx |
Sorry, I've just saw https://github.com/twbs/bootstrap/blob/v4-dev/scss/_modal.scss#L25-L27 |
It's sort of weird that you're able to scroll in the background, as we're applying ...or at least we should be. Maybe we should be using a jQuery selector like |
After researching this a bit more again, we're probably going to need some additional JS to make this happen as intended. Nothing I've tried has stopped the scroll 100% of time on iOS and desktop. |
There's a tiny hope that iOS/webkit may, in future, support scroll-chaining control via |
@patrickhlauke, but it also affects Firefox |
Firefox, and any other browser, on iOS uses webkit, so it's a moot point |
I've been dealing with this problem in various capacities for a long time. There are many answers out there that all have some major issues. I came across a codepen a few days ago that actually solved the issue with the least amount of drawbacks yet (I am not the author of the codepen): https://codepen.io/anon/pen/PExoGR Here are the drawbacks:
Obviously https://developers.google.com/web/updates/2017/11/overscroll-behavior would be a thousand times better if apple ever supports it... sigh |
So Here's the snippet I refer to _tables.scss |
Any news regarding this? |
Is there a valid workaround to prevent the scroll of the background when the modal is scrollable? |
Best I’ve seen is
https://www.npmjs.com/package/body-scroll-lock
… On Jul 4, 2019, at 6:09 AM, Gary Lockett ***@***.***> wrote:
Is there a valid workaround to prevent the scroll of the background when the modal is scrollable?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I came across a potential solution on Stack Overflow today, which can be tested at https://daguy.github.io/ios-modal-fix/. I've tried this in iOS Simulator, and unlike the modal test outlined at https://getbootstrap.com/docs/4.3/components/modal/#scrolling-long-content, this test page doesn't allow the body to scroll underneath the modal. I'm aware much of this will be fixed by Safari 13 (see this specific note, but I though it worth raising here for the benefit of other developers unaware. |
Closing as a (very old) duplicate of #22311. I missed the above comment about this being fixed in iOS 13. See the comment at #22311 (comment) and weigh in if we should add this the overflow scroll back in knowing it could negatively affect some iOS users. |
Hello!
Firstly I've encountered this issue with v3.3.7.
The problem occurs with Firefox mobile and Safari
I've found this thread:
https://stackoverflow.com/questions/21024774/twitter-bootstrap-3-modal-on-mobile-scroll-issues
which covers this bug. I've tried proposed solutions but is haven't solved my problem, so I decided upgrade to v4 beta 2. And the bug still exists!
The text was updated successfully, but these errors were encountered: