Comments (14)
What device(s) are you seeing the issue on?
from bootstrap-modal.
Samsung Galaxy SIII
From: Jordan Schroter [mailto:[email protected]]
Sent: Monday, December 17, 2012 5:02 PM
To: jschr/bootstrap-modal
Cc: wwwboy
Subject: Re: [bootstrap-modal] Content of a page is scrolling on mobile brosers (#44)
Hey what devices are you seeing the issue on?
—
Reply to this email directly or view it on GitHub #44 (comment) .
from bootstrap-modal.
Just ran into this with the latest version of bootstrap-modal on iOS 6.0.1 (iPhone 4).
The Long Modals example exhibits the bug.
from bootstrap-modal.
I believe this to be more of an issue with iOS not respecting overflow:hidden. It acts as though you have a scrollable container within a scrollable container so you actually need to use 2 fingers to scroll the modal itself.
This is why libraries such as touchscroll.js and iscroll.js exist. I have a couple ideas I would like to try before adding an additional library requirement. Worst case I would also like to add a Wiki about how to use these libraries with bootstrap-modal.
from bootstrap-modal.
That'd be neat =)
p.s. Encountered this on a friend's BlackBerry Bold 9900 as well.
Guess it might be a universal Webkit problem on mobile?
from bootstrap-modal.
Have the same problem on Android 4.1 with latest version of Chrome. Cannot scroll the modal, but when trying to scroll the background is scrolled.
from bootstrap-modal.
This is still kind of experimental, but you can try adding the following css rule to bootstrap-modal.css which may fix the problem:
.modal-open .page-container{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: inherit;
}
This is currently working for me on my iPhone 5 with the latest bootstrap-modal.
from bootstrap-modal.
That rule fixes the issue for me somewhat on my iPhone 4 running iOS 6.0.1. Thanks!
The issue with this rule though is that a (very long) page is scrolled to the top whenever the modal is displayed, causing a loss of context after the modal is hidden. Scrolling a long modal is a little funky at the ends as well -- if you attempt to continue scrolling past a modal's footer containing a Close button, the button will be partially hidden.
from bootstrap-modal.
Ah yes, now I remember why I didn't include that solution before :).
You may want to wrap the rule in a media query so it only does this for phones/tablets where the modal takes up the full screen anyways.
@media (max-width: 979px) {
.modal-open .page-container{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: inherit;
}
}
This is more of a hack then anything, I suppose you could also save off the scroll offset and reapply once the modal is done as well just to make it even more of a hack. Sadly, I don't think there is a css only solution to this and probably involves using a custom scolling library that I mentioned above.
from bootstrap-modal.
same mobile scrolling issue on Android 4.1.2 with both stock and chrome browsers - Razr Maxx device
from bootstrap-modal.
jschr could you provide an example/demo of how one could use a custom scrolling library to fix this issue?
from bootstrap-modal.
Unfortunately I never got a chance to test any of the custom scrolling libraries as I decided not to go down the route for my app. If you come across any or decide to get ambitious and try it yourself I'd gladly add it to the wiki.
from bootstrap-modal.
same problem here with android 4.1.2 (stock and chrome).
from bootstrap-modal.
Having the same problem here. Actually, the modal works perfectly on the latest release of Android(using chrome and opera), I particularly don't know about the other versions, but on iOS(didn't check the version yet), the modal scrolling doesn't work properly... I mean, if you use two fingers instead of one, somehow, the scrolling happens.
from bootstrap-modal.
Related Issues (20)
- is there any compatibility issues with select2.js? HOT 1
- Construct ajax query (ie. ajax Contact form)
- can i use this without bootstrap HOT 1
- angular 1.2.* ng-include used inside ui-bootstrap - modal opening page scrolls to top
- Show Modal Without overlay.
- Modal opens with a delay compared to standard BS3 modal
- Use modal with form validation
- body class="modal-open" style="padding-right: 15px" HOT 1
- Modal don't scroll when closing top modal
- The bootstrap dependency is different between github repo and bower repo.
- make collapsable?
- event.relatedTarget()
- How to relocate modal inside into a div
- Publish as NPM package
- Incompatible with Boostrap 4? HOT 4
- when using this with bootbox.js ,the bootbox dialog style was confused HOT 9
- Stackable: Close modal when clicked outside
- Will you upgrade to Bootstrap 4? HOT 1
- event listener for complete loading
- Replaced # with javascript:; in this statement and it worked.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-modal.