bootstrap
bootstrap copied to clipboard
Auto position does not work correctly when dropdown is in nav tag #v.5
- Operating system and version (Windows)
- Browser and version (All)
- https://codepen.io/alexshnur/pen/qBrOPNb?editors=1010
The problem is we don't initialize Popper for dropdowns in the nav element, tho I'm not sure why (I wasn't aware of this).
As a workaround you could add .dropdown-menu-end
to the dropdown-menu element to have it right-aligned.
this does not solve the problem for dynamic content
I was running in to the same issue. The following workaround solves the problem for me to render some right-aligned dropdown menu:
<div
class="dropdown-menu dropdown-menu-end"
:class="{ show: showMenu }"
data-bs-popper
>
</div>
This works because the CSS selector include data-bs-popper
. Not sure if that causes other side effects though.