-
-
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
Padding problem when there is a forced scrollbar #28101
Comments
hello @ZiluckMichael plz remove below given css :root { |
The reason for the ticket is I need to have that bit of CSS for other purposes within my application. My website requires the scrollbar to be visible even when the vertical content does not require it. Right now, Bootstrap does not account for this. |
Hi @ZiluckMichael . html{ and it seems to work with your problem. |
I managed to fix the issue, all I had to do was change the ":root" selector to "body" instead. Regardless, this is still a bug that could be fixed so I thought it was helpful to open an issue. |
Hello, I just face the same problem, and looks like there's a padding issue all the time event if the scrollbar isn't forced but display due to content overflow. I had try to use the fix with the 100vw on html element but it makes an horizontal scroll apear, and need to add an overflow-x:hidden on the body which is very bad for accessibility : https://codepen.io/anon/pen/NJKZwX Can't find in git history why that padding was added? maybe for IE8 or older non-supported browser in v4? |
I've made some tests, and it looks like
@fat I think there's a good reason for all that code you write, but I can't find why in git history, any idea to refresh our memory? Would you like a PR to try it in action and compare the comportement before and after? |
…ar is displayed see twbs/bootstrap#28101 for more information
@ZiluckMichael How did you change the .root selector to body? |
Closing as stale for v4. We'll be moving onto focus entirely on v5 and v4 will only see critical updates. |
omg that's worked, when I use 'overflow : scroll' then overflow is not show, body element will create padding-right : 15px |
There is an issue with the way modals add margins to account for the scroll bar. This issue occurs in the most recent releases of both Bootstrap 3 and 4.
When a browser is forced to display the scrollbar when the vertical content does not require the scrollbar, a padding-right is added to the body when it is not necessary.
Two jsfiddle examples are below that show the problem.
Bootstrap 4:
https://jsfiddle.net/ziluckmichael/fh71sgo0/
Bootstrap 3:
https://jsfiddle.net/ziluckmichael/nvz0ybux/
As you can see it adds padding-right to the browser when it is not required. Both examples use the default code almost exactly as it is off of the demo page.
Browsers Always Affected:
Browsers Sometimes Affected:
For IE 11, the issue does not occur on my test/demo of the problem, but it does occur on the actual production website where I discovered the issue originally. It appears this is because IE overlays the scrollbar and has it slowly disappear, while every other browser has it permanently on the screen.
The text was updated successfully, but these errors were encountered: