-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Open modal is shifting body content to the left #9855
Comments
I can confirm that I see this also on Chrome for Linux, both on getbootstrap.com and on the |
@jamescostian If you mean on the CDN, that's outdated. Could you clarify whether you mean git or the CDN? |
@cvrebert Via git. I even rebuilt the JS, and it's still doing this. |
Yup, saw this as well when I enabled scrollbars all the time in OS X. /cc @fat |
This fix causes the page to jump 15px to the left when a modal is opened on desktop and iOS Safari. In those environments there is normally no scrollbar to cover - and who says a scrollbar is always going to be 15px?! Before (blur to cover private content): (image removed) After: (image removed) You can see the extra 15px on the right - look at the navbar. What isn't so obvious is that the body text has also moved to the left. Same problem on desktop Safari. |
Also happens on OS X Chrome. |
This is #9886 |
Okay, so what Twitter does now is they run a script to determine the width of the scrollbar and then apply conditional CSS to adjust the modal and page contents accordingly. They know when say OS 10.8 has scrollbars visible when scrolling vs always visible, for example. It's truly the only way of making it happen. So, no matter what, we need some scripting to help us apply the styles. /cc @fat |
@mdo the modal already needs some scripting to be functional. |
Oh crap! duplicated multiple times!, my bad. Apologies |
EDIT: After lots of tweaking and testing, the shift still occurs (on Win7 Pro Chrome (29) and Firefox (22) and iPad Safari (6.1.3)), I came to this conclusion: If the body has already scrolling, there is no shifting, but, if the modal overflow-y is 'scroll' and the body hasn't got a scrollbar, then it shifts. |
There are some pixels added even if the body already has scrolling, and that's on 15" screens. |
+1 form me too! i'm on osx: using firefox, the everything seems ok, the scrollbar takes an actual 15px of the viewport. when the modal is opened, the scroll-y gets hidden and the 15px shift correctly keeps the website in place (if the shift wouldnt be there, the website would jump 15px to the right). using chrome, its different. the scrollbar in chrome does not take an actual 15px of the viewport... its like an overlay here. opening the modal still triggers the 15px shift, which is in that case not correct maybr this clarifies the issue |
Just confirming that this is still an issue. Tested on OSX safari, chrome, firefox. |
This does not happen with v2.x.x So can't we use the same method to display the modal as in 2.x.x? |
As far as I know the reason it's different to v2 is so that scrolling works better - you can now scroll the page as normal, with the modal setting the limits, rather than having to scroll within the modal if it overflows, which on scrollbar-less systems is particularly bad as you would never know there was overflow-scroll hidden content as you can see the whole model so why would you think some part of it needed to be scrolled? I know that the final RC worked perfectly for me, and that this change came between that final RC and the release. My proposed solution is to make the fade cover the whole page, and let you scroll the page as normal, with the modal given an absolute position rather than its own scroll area within the fade. #9339 |
I'm still getting this issue on OS X 10.9.1/Safari 7.0.1 and Firefox 27.0.1 using master. |
+1 |
… dialog on account of Lion non-scrollbars and inconsistencies elsewhere
On Bootstrap 3.1.1, still got the issue. And fixed with following code: |
@yshing great work 👍 |
@yshing On what OS and browser? |
@cvrebert ON OSX 10.9.2 CHROME |
I'm not surprised v3.1.1 has an issue btw—this fix won't land until v3.2 ships. |
🤦 Gah. We really ought to 🚢 that soon. |
@yshing Maintenance done successfully! ;) |
Thanks @yshing |
I fixed it by adding a width:100% on the body css. |
based on: twbs/bootstrap#9855 (comment) Reviewer: Tiff Go (post commit) Issue: Improvement
Port the scrollbar-width detection introduced in bootstrap 3.2.0 to angular-ui-bootstrap. The original issue in bootstrap is at twbs/bootstrap#9855.
- Contents body 15px shifting bug when launch modal component is fixed in v3.2.0 Refer: twbs/bootstrap#9855
… dialog on account of Lion non-scrollbars and inconsistencies elsewhere
When launching the modal component (http://getbootstrap.com/javascript/#modals) the entire content will slightly move to the left on mac OS (haven't tried it on windows yet). With the active modal the scrollbar seem to disappear, while the content width still changes.
You can observer the problem on the bootstrap page
The text was updated successfully, but these errors were encountered: