I'm using bootstrap's "btn-toolbar" class to house a few "btn-group" class dropdown buttons on the same line. I want the btn-toolbar div to have a fixed with so that it can be x-axis scrollable on smaller screens, so I need a parent div to house the "btn-toolbar" in order to make it ovreflow-x: scroll
, and have the btn-toolbar
retain it's width off-screen.
The issue is, with the parent div in place, the dropdown menus are partially hidden behind the parent div. When I remove the parent div (and the ability to x-axis scroll), it works just fine. It also works with divs directly under it. Is there a way to manipulate the elements associated so that I can keep the parent div?
Any ideas are greatly appreciated!
I've tried changing the z-index of all the associated divs and dynamic classes associated with the dropdown.
<div class="wrapper">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<button class="btn btn-outline-primary dropdown-toggle"
type="button" id="dropdownMenuButton" data-
toggle="dropdown" aria-haspopup="true" aria-
expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-
labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else
here</a>
</div>
</div>
</div>
.wrapper {
width: 100%;
overflow-x: scroll;
border-bottom: solid 1px #ccc;
}
.wrapper::-webkit-scrollbar {
display: none;
}
.btn-toolbar{
min-width: 1000px;
}
.btn-toolbar button {
padding: 2px 8px;
margin: 8px 5px;
color: #1eafed;
border-color: #1eafed;
}
I expected the dropdowns to show on unfurl, but instead they seem to be hidden behind the bottom of the wrapper
div (only about 50px tall) and beyond.