JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://rawgit.com/stefansundin/bootstrap/compiled/dist/js/bootstrap.min.js"></script>
<div class="text-center">
<h1>Test Modal Scrollbar Bug</h1>
<p><b>This is the fixed version!</b></p>
<p>First, open modal when scrollbar is present. Close modal.</p>
<p>Then, resize window so scrollbar disappears.</p>
<p>Open modal again, this content should not shift.</p>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Open modal
</button>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
<p>Lots of content</p>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>