I've already read a few question-answer pairings on Stack, all of which advocate wrapping your overflowing content element inside of a different div
element in order to make it look like the scrollbar from the first element has been offset from its right edge. The below question illustrates my goal graphically: CSS: Possible to "push" Webkit scrollbars into content?.
<div class="col-xs-10 col-xs-offset-1 dropdown" id="filter1">
<button class="btn btn-default dropdown-toggle btn-block" type="button" data-toggle="dropdown">
Button Name
</button>
<div class="formatting_wrapper">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="disc_menu filter"><a role="menuitem">Option 1</a></li>
<li role="presentation" class="disc_menu filter"><a role="menuitem">Option 2</a></li>
</ul>
</div>
</div>
So when I wrap the above <ul>
element inside of an extra div (.formatting_wrapper
), it does allow me to create the illusion that I've offset the scrollbar.
My problem is that the toggle button no longer functions properly: It will open and close correctly, but only once. After that it retains the focus
/ open
border and will not de-activate or open a second time. Essentially it freezes.
What can I do if I want to retain the scrollbar formatting AND keep BS working as intended? I tried to look into the dropdown.js
for BS but I'm kind-of a javascript novice.
Cheers
Edit: Here is a working example of my problem in Fiddle.