-
-
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
Modify scrollbar check, stop static nav shift #13103
Conversation
this.isShown = null | ||
this.options = options | ||
this.$body = $(document.body) | ||
this.$fixedNavs = this.$body.children('.navbar-fixed-top, .navbar-fixed-bottom') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we'd have to add a bunch more special cases and/or support for the user adding their own special cases... 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two classes are the only ones I've really seen cause a problem as far as base bootstrap and this solution is concerned.
User special cases should be handled via the show.bs.modal
event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cvrebert do you think that the static-nav cases should handled elsewhere?
The change from inspecting window.innerHeight
to checking window.innerWidth
to denote the presence of scrollbars should fix the solution that's already out there while leaving the navbar-fixed-[whatever]
alone (i.e., leaving them shifting right).
Would this pull request be better to just address the issue with IE10/11?
I'm really eager to see some fix roll so that I can update my own codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this pull request be better to just address the issue with IE10/11?
that's just what i was going to ask.
The fixed problem is actually just a rendering bug with chrome (asfaik) – works fine in firefox, etc.
@thcipriani could you also squash your commits! thanks! |
@fat squashed and focused only on IE10/11 |
lgtm – thanks a lot |
@fat So, we can merge this? |
yep, looks good to me |
Version 3.2.0 keeps shifting my body to left, so I end up commenting |
@eugenzaharia can you provide a jsfiddle micro example for what you're seeing, or, let me know if you're seeing it on http://getbootstrap.com/javascript/#modals Also, can you provide your OS/Browser version combo for which you're having this issue. Also, probably a good idea to open a new issue once you have those things to make management easier. Thanks! |
Having the same problem with 3.2 using chrome. Fixed it via
|
@whoknowsit. Nice job. Confirmed fix with FF 34.0.5 and Chrome 39.0.2171.95 m when scrollbar is forced into page. Bootstrap version 3.2.0 |
Now, i use this:
|
@whoknowsit thanks - your previous fix works for me (with the overflow-y:auto). Adding all the navbar classes causes my navbar to jump. This is a pesky ass little bug. body.modal-open { Version 39.0.2171.65 Built on Ubuntu 14.04, running on LinuxMint 17.1 (64-bit) |
I guess, it depends on some factors, what's working and what not. |
Tested working: