Skip to content
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 open causes fixed content to shift #20824

Closed
eddywashere opened this issue Oct 2, 2016 · 3 comments
Closed

Modal open causes fixed content to shift #20824

eddywashere opened this issue Oct 2, 2016 · 3 comments

Comments

@eddywashere
Copy link

I believe there is an issue with opening modals that causes fixed content to be shifted.

Here's an example http://codepen.io/eddywashere/pen/ZpXrxQ

I'm on OSX, 10.11.5, Chrome 53 and have System Preferences > General > Show scroll bars: always.

I believe this is sort of tracked in the Modal section of v4 issue #17021, but does not contain an active issue to track it.

Finally fix that shifting content bug by updating the modal.js to not adjust body padding, but rather the padding on a specific set of classes.

I found an issue that was closed because it was part of v3, #14040 (comment).

@tiesont
Copy link
Contributor

tiesont commented Oct 27, 2016

I don't see the same problem on the docs site, and the only difference I've noticed is that something is adding a style="padding-right: 33px" to the <body> element. Granted, the docs do not use a fixed navbar, so maybe that has something to do with it?

@judetucker
Copy link

So this issue seems to be caused by this javascript (https://github.com/twbs/bootstrap/blob/v4-dev/js/src/modal.js#L428) that reads the width of the user's scrollbar and adjusts the <body>accordingly, BUT doesn't take into account fixed navbars because they have position: fixed;

This is an definitely an interesting issue that we struggled with as well.

@pvdlg
Copy link
Contributor

pvdlg commented Jan 22, 2017

X-ref #21800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants