Dropdown menu hides behind scrollbar
Bug description:
Under certain conditions (described below), the dropdown menu is hidden behind the scrollbar:

It seems that the re-positioning of the dropdown-menu does not take into account the scrollbars and hence does not re-position the menu even if it overlaps the scrollbar, src/util/positioning.ts, from line 149:
const windowWidth = window.innerWidth || html.clientWidth;
return targetElBCR.left >= 0 && targetElBCR.top >= 0 && targetElBCR.right <= windowWidth &&
targetElBCR.bottom <= windowHeight;
Link to minimally-working StackBlitz that reproduces the issue:
Minimally-working example with:
- dropdown showing the described bug
- re-positioned dropdown showing the normal behaviour
https://stackblitz.com/edit/angular-oadfwh
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 9 ng-bootstrap: 5.3.0 Bootstrap: 4.4.1
Update and potential workaround: in our situation, we knew that the button will always be at the right bottom of the screen, so just added a priority placement (https://ng-bootstrap.github.io/#/components/dropdown/api).
This issue is related to the way you html is structured.
There is probably an overflow specified somewhere that lead to the visual artefact.
Possible solutions are as follow:
- As you mentioned, you can specify a different placement.
- Use
container="body"on the dropdown to actually render the menu as a detached DOM node in the body, rendered absolutely above everything.
Hence I'll close this issue with these explanations as you finally workaround it.
Thanks for the explanation and your efforts!