question about data-bs-popper #40963
-
is there a way for class="dropdown-menu" to not has data-bs-popper="static" that default from wrapped with class="navbar" <header class="navbar main-header navbar-fixed-top bg-primary sidebar-collapse navbar-expand-md">
<div class="second-navbar">
<button type="button" class="btn btn-sm btn-primary">
<span>Update</span>
</button>
<button type="button" class="btn btn-sm dropdown-toggle dropdown-toggle-split btn-primary" data-bs-toggle="dropdown" aria-expanded="false" data-bs-reference="parent">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li class="dropdown">
<button class="dropdown-item"><i class="fa fa-edit"></i><span>Update</span></button>
</li>
<li class="dropdown">
<button class="dropdown-item"><i class="fa fa-edit"></i><span>Upd. Berangkat</span></button>
</li>
</ul>
</div>
</header> even if i add data-bs-display="dynamic" in button the dropdown-menu still has data-bs-popper="static"
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Based on the code here: Lines 312 to 319 in 30e0152 It seems the answer is no. The algorithm explicitly checks if the dropdown is inside a navbar and then enforces the attribute There may be a potential workaround, though: the algorithm determines whether it's in a navbar by checking for the presence of the |
Beta Was this translation helpful? Give feedback.
Based on the code here:
bootstrap/js/src/dropdown.js
Lines 312 to 319 in 30e0152
It seems the answer is no. The algorithm explicitly checks if the dropdown is inside a navbar and then enforces the attribute
data-bs-popper="static"
.There may be a potential workaround, though: the algorithm determines whether it's in a navbar by checking for the presence …