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, navbar fixed-top, margin-right 16px and overflow scrollbar. Bug. #1017

Closed
ghost opened this issue May 11, 2018 · 2 comments
Closed

Modal, navbar fixed-top, margin-right 16px and overflow scrollbar. Bug. #1017

ghost opened this issue May 11, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented May 11, 2018

Reactstrap 6.0.1.

When I use header navbar fixed-top navbar-expand and I open a modal and reacstrap adds margin-right: 16px to the body element the navbar fixed doesn't move to the left like all the page.

Is it really useful to add that margin-right: 16px ?

Can we agree on leave there the scrollbar? Why we need to hide it?

@TheSharpieOne
Copy link
Member

The intent is not to hide the scrollbar, it is to prevent scrolling of the page (and allowing scrolling of the modal if the modal is too tall)
The addition of the padding is to make up for the scrollbar disappearing.
This is how bootstrap handles it, the issue should be opened there for them to create a fix upstream so reactstrap can implement it.
It's worth noting Bootstrap's documentation website does not have this issue, this is because they do not use .fixed-top, they have custom styles 😱. These custom styles (.bd-navbar) apply position: sticky which override position: fixed keeping the same result but fixing the issue you are seeing. The only problem is: position: sticky is not supported in IE and is only in more recent version of edge (and with bugs).
So the workaround (if you can go without IE) is to use position: sticky, until then an issue should be opened with bootstrap.

@ghost
Copy link
Author

ghost commented May 11, 2018

twbs/bootstrap#26489

@ghost ghost closed this as completed May 11, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant