You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using multiple Placement values to position a popover, if none of them result in the popover being on screen, the first Placement is used to position the popover, but the lastPlacement is used to control where the popovers arrow appears.
Link to minimally-working StackBlitz that reproduces the issue:
Click on the button to open the popover. The popover will appear centered over the button, but the arrow will be to the right edge of the popover.
If you change the placement order in app.component.html to ['top', 'top-right', 'top-left'], the arrow will appear towards the left edge of the popover. If you change the placements to just contain top, the arrow is centered as you would expect.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 7.2.6
ng-bootstrap: 4.0.4
Bootstrap: 4.3.1
The text was updated successfully, but these errors were encountered:
I think this was introduced in either #3017 or #2972 when some of the positioning logic was changed. When it's trying the different placements, if the placement doesn't result in the element being on screen, it removes the CSS classes it added except if it's the last placement it's trying. If the final placement didn't put the element on screen, then it applies the first placement, but it still has the last placement's CSS classes applied.
Bug description:
When using multiple
Placement
values to position a popover, if none of them result in the popover being on screen, the firstPlacement
is used to position the popover, but the lastPlacement
is used to control where the popovers arrow appears.Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-ducwpd
Click on the button to open the popover. The popover will appear centered over the button, but the arrow will be to the right edge of the popover.
If you change the
placement
order inapp.component.html
to['top', 'top-right', 'top-left']
, the arrow will appear towards the left edge of the popover. If you change the placements to just containtop
, the arrow is centered as you would expect.Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 7.2.6
ng-bootstrap: 4.0.4
Bootstrap: 4.3.1
The text was updated successfully, but these errors were encountered: