bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

`.dropdown-center` and `.dropup-center` in `.navbar` not working

Open Sysix opened this issue 3 years ago • 6 comments

Prerequisites

Describe the issue

When a Dropdown with .dropup-center or .dropdown-center is inside .navbar the centering is not working. Because it checks itself if it's inside .navbar and will disable popper auto positioning:

see: https://github.com/twbs/bootstrap/blob/v5.2.0/js/src/dropdown.js#L309

Reduced test cases

https://stackblitz.com/edit/jbtery?file=index.html

What operating system(s) are you seeing the problem on?

Windows, macOS, Android, iOS, Linux

What browser(s) are you seeing the problem on?

Chrome, Safari, Firefox, Microsoft Edge, Opera

What version of Bootstrap are you using?

v5.2.0

Sysix avatar Aug 03 '22 18:08 Sysix

Hello @Sysix.

It is a fair observation. Is happening because most of documented dropdown position-classes are handled by javascript (popper). In case we have a dropdown inside navbar, we do not use the popper engine

It will be closed by #35901

GeoSot avatar Aug 04 '22 08:08 GeoSot

Any update ? It has been more than a year

mrleblanc101 avatar Aug 09 '23 20:08 mrleblanc101

Any workarounds? I'm surprised this was overlooked and apparently complicated enough to still not be resolved. Makes me feel better about trying to figure out the problem for the last hour.

currentcreative avatar Nov 28 '23 19:11 currentcreative

i taught im missing something. when will there be a fix?

ZuK94 avatar Dec 25 '23 20:12 ZuK94