Modal - Screen Flickers on Open and Hide
Anyone else?
What browser and OS?
can be verified at: http://twbs.github.io/bootstrap/javascript/#myModal
Chrome: Version 28.0.1500.71 Mac: 10.6.8
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 Windows 8
maybe this is what? when we open the left side there?
http://www.screenr.com/arpH
chrome 30.0.1573.2 dev-m windows 7
@kukac7 I noticed 3 things:
1 - When the Modal shows - the parent document's indent shifts right. On close it shifts back. 2 - Flickering can be repeated with Safari as well - probably something to do with the item 1. 3 - On Mac + Chrome - While the flicker happens, at times, chrome will become "translucent" for an instant and you will be able to see any windows behind it.

@r1c4r60 Pretty sure (3) is a general Chrome bug. I've experienced it several times recently on various sites.
Flicker for me and I'm using Chrome: 28.0.1500.72 m (Windows 7). For a few seconds the scrollbar is duplicated, during the opening. I think this may be causing the problem.

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 :
$(this).on('hidden.bs.modal', function() {
// do stuff
$(this).remove();
}
}).modal('hide');
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:
- First scrollbar for body - it is not hidden yet.
- Second scrollbar for modal - it is shown already.
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):
- use .modal-open to set the container behind the modal to position:fixed (this kills the scrollbar)
- set the top value of the container behind the modal to -{{scrollTop}} (this keeps the container at its previous scroll position)
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 .modal-shiftfix div
<body>
<div class="modal-shiftfix">
.....
</div>
</body>
P.S. Tested in Chome/Firefox/Safari for Mac and IE8/Opera for Windows
#9419
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{ margin-right:0px!important; }
.modal-open .navbar-fixed-top{ margin-right:0px!important; }
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. Also when the closing animation has finished, it flickers once (so for 0.1 second, I can see the modal again in the middle of the screen, which just finished it's closing animation).
Ditto here, seeing it on Mac w/ Chrome 29.0.1547.65.
The 15px shift is covered by #9855.