Having multiple bootstrap 4.4.1 dropdown menus, each within a column which is functioning correctly except for the position calculation. Example of HTML col:
<div class="container">
<div class="row">
<div class="col">
<div class="dropdown">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="snl-68778" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="0"><div class="btn-txt">TEXT</div><div class="chevron-wrapper"><svg class="chevron"><use xlink:href="/img/chevron-white.svg#chevron"></use></svg></div></a>
<div class="dropdown-menu" aria-labelledby="snl-68778" style="">
<a class="dropdown-item" target="_blank" href="#" tabindex="0">Link 1</a>
<a class="dropdown-item" target="_blank" href="#" tabindex="0">Link 2</a>
<a class="dropdown-item" target="_blank" href="#" tabindex="0">Link 3</a>
<a class="dropdown-item" target="_blank" href="#" tabindex="0">Link 4</a>
<a class="dropdown-item" target="_blank" href="#" tabindex="0">Link 5</a>
</div>
</div>
</div>
// more columns here
</div>
</div>
CSS:
.btn,
.dropdown-menu {
width: 100%;
}
.btn{
display: inline-block;
padding: 8px 15px;
border: none;
background: #E5392A;
color: #fff;
text-align: center;
font-size: 12px;
font-weight: 800;
letter-spacing: 1.5px;
line-height: 18px;
text-transform: uppercase;
}
.dropdown-menu{
margin-top: 0;
border: 0;
padding: 0 10px;
background-color: #211D17;
}
.chevron-wrapper {
vertical-align: middle;
display: inline-block;
width: 36px;
height: 26px;
border-left: 1px solid #fff;
margin-left: calc(100% - 115px);
padding-left: 10px;
}
.dropdown.show .chevron {
transform: rotate(90deg);
}
.chevron {
display: inline-block;
width: 26px;
height: 26px;
}
I have set up 5 columns and the issue I am facing is the positioning of the dropdown menu in the first and last columns:
1st: translate3d(5px, -244px, 0px);
5th: translate3d(-5px, -244px, 0px);
There seems to be a 5px shift to the left/right and I cannot pinpoint the cause. Even if I reduce the number of columns to 4, the same shift occurs on the first / last columns.
Is there a way to always force the first number in the calculated translate3d(5px, -244px, 0px) to be 0? I attempted using transform: translateX(0), but it overrides the entire translate3d() setting, not just X
Any suggestions?