This repository was archived by the owner on May 29, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated for the new branch.
I added the
modal-open
class when a modal opens and remove it when it closes, but this may open a can of worms. In Bootstrap 3 they decided to add a modals scrollbar to themodal
itself, rather thanmodal-body
.This is causing a 15px shift in the rest of the body, because the modal scrollbar is absolutely positioned (whereas the body's is not). This is still being worked on per twbs/bootstrap#9855. The last response to this suggests to progmatically determine how wide the scrollbar is on that particular browser, than add a
margin-right
to the body to offset the difference between the scrollbars. The only way I'm aware of how to do this is to make a hidden element, add it to the dom and get the difference between theelement.clientWidth
and theelement.offsetWidth
. Totally worth it to have the scrollbars on thebody
rather thanmodal-body
, right? 😠The other issue we may run into, that I haven't tested, is that stacked modals may have multiple scrollbars. So if we have 2 modals in the stack, 2 scrollbars may show. I haven't really tested this so maybe the absolute positioning of the modals will render that moot (the scrollbar of the top modal may overlay the modal below it... hopefully).