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 placement via function or 'auto' argument #992

Closed
cquillen2003 opened this issue Oct 31, 2016 · 11 comments
Closed

Popover placement via function or 'auto' argument #992

cquillen2003 opened this issue Oct 31, 2016 · 11 comments

Comments

@cquillen2003
Copy link

In the Bootstrap 4 docs, the popover's placement option can accept a function or an 'auto' string argument: http://v4-alpha.getbootstrap.com/components/popovers/#options

Does ng-bootstrap plan to support this?

I need this to make sure that popovers near the edge of the screen do not overflow.

@mscudlik
Copy link

i have the same issue with popovers near the edges

@cannontechnology
Copy link

I have the same issue. Is there an ETA on "auto" placement?

@anhkind
Copy link

anhkind commented Oct 12, 2017

The auto feature is working well for the cases when

  • the top edge of the popover touches the top edge of the viewport
  • the bottom edge of the popover touches the bottom edge of the viewport

However, we don't have the same behavior for the left and right edges of the popover. Is it a bug or something that we're already aware of?

@mscudlik
Copy link

for me auto is not usable because of the missing container functionality

@cannontechnology
Copy link

Ideally it would be nice to implement this the same as bootstrap. Specify auto and then the default position. When the default is outside the viewport it should flip to the opposite. So "auto right" would default to right and when right is outside the viewport it would shift to the left.

@pkozlowski-opensource
Copy link
Member

@cannontechnology but we've got support for this already via [position]="[right, 'auto']". If there is anything else missing here please open a new issue - commenting on closed issues will not result in any investigations / fixes.

rmeans pushed a commit to fcsa-teamhammer/ng-bootstrap that referenced this issue Oct 18, 2017
@alejandrocuba
Copy link

alejandrocuba commented Dec 8, 2017

@anhkind in the meantime there is a way to deal with the left and right edges. Depending on the proximity of the popover to the viewport's lateral edge, you might want to use:

[placement]="['right', 'left', 'auto']"

OR

[placement]="['left', 'right', 'auto']"

@GIOkafor
Copy link

GIOkafor commented Feb 27, 2018

Popover still overflows despite
[placement]="['left', 'right', 'auto']"
Anyone else manage to get it working?

@jgaffod
Copy link

jgaffod commented Aug 14, 2018

Is there any solution for this issue now?

@leye0
Copy link

leye0 commented Oct 21, 2019

The presence of this type of feature is the -only- reason I'd use bootstrap popovers over a custom solution. Yet it is not working.

@maxokorokov
Copy link
Member

@leye0 please look at https://ng-bootstrap.github.io/#/positioning and open an issue, if something is not working for you → https://github.com/ng-bootstrap/ng-bootstrap#you-think-youve-found-a-bug

@ng-bootstrap ng-bootstrap locked as resolved and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants