valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.52k stars 1.69k forks source link

Popover `placement="bottom left"` with `[adaptivePosition]="true"` throws error #6617

Open tiago-eusebio-dev opened 6 months ago

tiago-eusebio-dev commented 6 months ago

Bug description:

When using placement="bottom left", if the popover has no space on bottom left, the adaptivePosition may endup changing the position to "left left", causing an error to be thrown: image

After some debugging I verified that somewhere the flip function is called and returns a new left left position, which is not a valid key for PlacementForBs5, causing the error: image

StackBlitz/GitHub repo that reproduces the issue:

Force the issue to occur by using a small resolution like 753x133.

StackBlitz: https://stackblitz.com/edit/ngx-bootstrap-popover-positioning?file=src%2Fapp%2Fpopover%2Fpopover.component.html

GitHub: https://github.com/tiago-eusebio-dev/ngx-bootstrap-popover-positioning

Versions used

ngx-bootstrap: 11.0.2 Angular: 16.2.12

Expected behavior

Not to throw a console error.

daniel-t4e commented 6 months ago

I am having the same issue with angular 15.2.9 and ngx-bootstrap 10.3.0. Is there any update if this will be fixed?