Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover positioned partially off-screen and cropped #2924

Open
peterblazejewicz opened this issue Dec 12, 2018 · 5 comments
Open

Popover positioned partially off-screen and cropped #2924

peterblazejewicz opened this issue Dec 12, 2018 · 5 comments

Comments

@peterblazejewicz
Copy link
Contributor

The top popover, when triggered near the page border, is being rendered in such way it gets cropped:
https://stackblitz.com/angular/rdokjdpkdoq
https://ng-bootstrap.github.io/#/components/popover/examples

image

The BS uses popper.js, rendering in 4.1.3:

image

ng-bootstrap: v4.0.0
Chrome, macOS

@maxokorokov
Copy link
Member

Ok, will reopen this as a feature request.

In case of the top placement above, bootstrap/popper SHIFT the popover horizontally until it fits (note the arrow is not centered), we will just crop it if ONLY top is specified → we don't support this feature.

P.S. Workaround would be using [position]="['top', 'auto']"

@maxokorokov maxokorokov reopened this Feb 19, 2019
@maxokorokov maxokorokov removed this from the 4.0.3 milestone Feb 19, 2019
@Sachin4dotnet
Copy link

Any update on this ?

@pelgro
Copy link

pelgro commented Sep 18, 2019

Pretty sure this is a bug. Secondary positioning should be applied to the arrow and not the whole popover window. At least that's how it works in popper.js

placement="top" results in top-center placement in positionElements. I believe the center placement should apply to the arrow and not the whole window. That way the popover will always be in the viewport as it's only moved above the reference object. And the arrow is centered to the reference element.

@Michael-Ziluck
Copy link

@maxokorokov Any update? This is an incredibly annoying shortcoming of using popovers in this library.

@janwidmer
Copy link

Any Update on this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants