bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

the background move a little when opening a modal.

Open jixiangcn opened this issue 12 years ago • 37 comments

when I click button to show a "modal", the background move a little then move back, which is not happened in bootstrap and uikit modal.

jixiangcn avatar Aug 26 '14 08:08 jixiangcn

https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md#you-think-youve-found-a-bug

pkozlowski-opensource avatar Aug 26 '14 08:08 pkozlowski-opensource

You can reproduce it open the following link in Chrome. http://angular-ui.github.io/bootstrap/ modal part press any of the 3 buttons, when the modal is showing, notice the background content (not the modal) move to right a little bit. In the uikit demo http://getuikit.com/docs/modal.html the modal opens smoothly, the background without any move.

jixiangcn avatar Aug 26 '14 08:08 jixiangcn

For more information about the issue: https://github.com/twbs/bootstrap/issues/9855

It seems that someone has already ported the fix, but hasn't made a pull request https://github.com/MrOrz/bootstrap/commit/1a4729a6ef8b9264b139c87523f597183d865e32

villelahdenvuo avatar Aug 26 '14 09:08 villelahdenvuo

:+1:

jixiangcn avatar Aug 26 '14 09:08 jixiangcn

@jixiangcn Why did you close the issue? I think it should be kept open until the fix has been ported to this library. I don't want to patch my own version of angular-bootstrap for this.

villelahdenvuo avatar Aug 26 '14 09:08 villelahdenvuo

A solution for this problem would be to calculate the scrollbar width and append the result to the tag as negative margin left.

kgierke avatar Sep 19 '14 14:09 kgierke

For reference, the original fix is at https://github.com/twbs/bootstrap/commit/0907244256d923807c3a4e55f4ea606b9558d0ca . PRs are are welcome.

chrisirhc avatar Sep 21 '14 08:09 chrisirhc

Faced with the same issue.

kashesandr avatar Aug 03 '15 09:08 kashesandr

issue can be seen even on the bootstrap-ui documentation website

TilmannBach avatar Sep 01 '15 10:09 TilmannBach

I am not able to reproduce it so I am not sure if this is stale or not. Please open an issue with a plunker if you think this is still an issue.

Thank you.

Foxandxss avatar Oct 15 '15 23:10 Foxandxss

@Foxandxss This is still an issue, as @TilmannBach says, you can see it on the doco website at https://angular-ui.github.io/bootstrap/#/modal but make sure you are using a browser that consumes a scrollbar width on the page, like FF or Chrome on Windows.

j3ffb avatar Oct 23 '15 15:10 j3ffb

Ah, missed the windows part. I am using mac with this annoying scrollbars.

Foxandxss avatar Oct 23 '15 15:10 Foxandxss

I get the same effect on OS X with Chrome (46.0.2490.80 (64-bit)) & Firefox (41.0.2)

NoelKennedy avatar Oct 23 '15 15:10 NoelKennedy

@NoelKennedy this will depend on your settings in OSX. If scrollbar is visible on page load = you will see the bug

j3ffb avatar Oct 23 '15 15:10 j3ffb

Windows 10

  • Edge: Ok
  • IE 11: Ok
  • Chrome 46: Bugged

TilmannBach avatar Oct 23 '15 15:10 TilmannBach

@j3ffb Confirmed; I can toggle the problem on and off via OS X settings. The screenshot is OS X settings (under General). With 'Show scroll bars' set to 'Automatically....' the problem occurs. If you set it to 'When scrolling' the problem does not occur.

screen shot 2015-10-23 at 16 47 09

NoelKennedy avatar Oct 23 '15 15:10 NoelKennedy

I'm not sure there's anything we can do here.

icfantv avatar Oct 28 '15 16:10 icfantv

Maybe this suggestion will help with the problem: http://stackoverflow.com/a/20564773/915372 ?

stefan-dimitrov avatar Jan 13 '16 08:01 stefan-dimitrov

Hello,

I don't know if this is still an issue for everyone but this should (hopefully) fix it:

CSS:

html {
  overflow-y: scroll;
}

That forces the scroll bar to be displayed at all times regardless of whether it's actually needed or not.

prasadrajandran avatar Feb 27 '16 03:02 prasadrajandran

@prasadrajandran that does stop the content from shifting, but it means the body can be scrolled while the modal is open, which feels wrong. I think we're all after a solution that's the best of both worlds -- scrolling is disabled, and content does not shift sideways.

bboyle avatar Feb 28 '16 06:02 bboyle