-
-
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
Modal - Screen Flickers on Open and Hide #8768
Comments
What browser and OS? |
can be verified at: http://twbs.github.io/bootstrap/javascript/#myModal Chrome: Version 28.0.1500.71 |
Doesn't flicker for me and I'm using Chrome: Version 28.0.1500.71 and Mac: 10.8.4. |
Do you mean when you open the model the screen shifts for a second? As whats happening when you open the model you get 2 scroll bars for a seconds and when closing you lose the scroll bar for a second. Chrome: Version 28.0.1500.71 |
maybe this is what? chrome 30.0.1573.2 dev-m |
@kukac7 I noticed 3 things: 1 - When the Modal shows - the parent document's indent shifts right. On close it shifts back. |
@r1c4r60 Pretty sure (3) is a general Chrome bug. I've experienced it several times recently on various sites. |
It does it for me with Windows7/Firefox 22.0 also. |
I'm having the same "flicker" effect on Chrome 28.0.1500.95 and Firefox 22 (on Windows 8). What I'm seeing is : On http://getbootstrap.com/javascript/ : main page scrollbar is replaced by modal scrollbar (with a slight overlap (2 scrollbars) during css transition) On my site : the scrollbar disappears (because my Modal has no overflow), but the scrollbar of the page reappears only if the modal is hidden using data-dismiss="modal", and NOT if calling the "hide" method, or for instance :
What happens then is that my page is stuck : I'm unable to scroll up or down... I'm new to Github, hope that helps! |
This does happen on Vista FF22. |
As far I understand, everyone must have this issue. It is not browser specific. Screen flickers during animated Modal opening/hiding because of double scrollbars:
|
The problem occurs on OSX if you don't have the iOS-style scrollbars activated. The iOS-style scrollbars overlay the page instead of indenting it, so the issue is not visible. But in OS/Browser environments that use 'static' scrollbars you get the issue as seen in the screenshot by @andrelom. A possible solution (Facebook does this, for example):
It's not what you would call pretty. It's also not ideal for Bootstrap because it requires a specific HTML setup. I'm very curious to see if/how this gets solved. This issue makes opening and closing of modals pretty whack on affected systems. |
It doesnt fix the issue for me. Working on Windows 7 with Chrome 28.0.15000.95 m. |
If you want quick solution until official fix: At first, define several styles: // Show scroll for modal only when modal is opened
.modal {
overflow-y: hidden;
}
.modal-open .modal {
overflow-y: scroll;
}
// Fix page shift when body scroll is killed
.modal-open .modal-shiftfix,
.modal-open .modal-shiftfix .navbar-fixed-top,
.modal-open .modal-shiftfix .navbar-fixed-bottom {
overflow-y: scroll;
} Then wrap entire page into <body>
<div class="modal-shiftfix">
.....
</div>
</body> P.S. Tested in Chome/Firefox/Safari for Mac and IE8/Opera for Windows |
I noticed that it happened to add 15pixel margin on the right... not sure why, but I added this as a custom style, and no more issues with the shifting. The first set fixes the issue with the body shifting over, the second corrects the navbar from shifting, obviously you only need the second if you are making use of the navbar. body.modal-open{ .modal-open .navbar-fixed-top{ |
I'm not sure whether it helps you, but I'm also using Chrome (29.0.1547.62) on a Mac (10.7.5) and I don't have 'double scrollbars' or anything like that, but rather when the modal showing animation has finished, it flickers once. |
Ditto here, seeing it on Mac w/ Chrome 29.0.1547.65. |
The 15px shift is covered by #9855. |
add 15px margin-right lead to the issue any case, so we need to determine document hasn't scroll?i try it // Show no-scroll for modal only when modal is opened $(document).ready(function(){ |
I'm in the process of uploading a video to vimeo that captures the flicker. It's be a bit before it is ready. |
@hlship Please open a new issue, because this issue is basically about the scrollbar problem. |
Here's that video; it's more visible when I close the dialog. |
Ok, I'll open a new issue. |
I'm having this issue on Win7 and OS X 10.8.5 in all browsers. Quick fix:
Tested OK in Win7: IE10, FF24, Chrome30; OSX: Chrome30, Safari6, FF24 |
Only tested on Mac OSX 10.8.5 Chrome 30 & Safari 6, but this sorted it for me:
|
Yeah iv tried all of the above and here is my quick fix. Adjust the width to 99% seems to make everything stay still. body.modal-open, .modal-open .navbar-fixed-top, .modal-open .navbar-fixed-bottom { Also try adding this class and adjust to your media queries. |
I can confirm @kingster996 's fix, it works. |
I used important to just make sure it's overriding the other class in bootstrap. I have tried kingsters suggestion but my body is pushed every time i hit the modal button and its really annoying. Applying a percentage width made everything stable. |
Oh, I now see that kingster's suggestion does the opposite in Mozilla Firefox for example, it shifts to the left... |
@krasnoperov Thanks buddy... It worked for me.... |
Anyone else?
The text was updated successfully, but these errors were encountered: