bootstrap
bootstrap copied to clipboard
`.dropdown-center` and `.dropup-center` in `.navbar` not working
Prerequisites
- [X] I have searched for duplicate or closed issues
- [X] I have validated any HTML to avoid common problems
- [X] I have read the contributing guidelines
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
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
Any update ? It has been more than a year
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.
i taught im missing something. when will there be a fix?