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 positioning and sizing incorrect when inside of navbar with dynamic HTML content #2346

Closed
dmi3lab opened this issue Apr 27, 2018 · 3 comments

Comments

@dmi3lab
Copy link

dmi3lab commented Apr 27, 2018

Bug description:

  1. Position of a popover incorrectly calculated.
  2. Position and size of a popover changes on click on the window.

Popover is placed inside of navbar and has a dynamic HTML content.

The issue appears to be related to popover's width changes due to dynamic nature of the content. Looks that ngbPopover calculates positioning before the internal content is fully displayed. And of course IE11/Edge acts differently.

IE11/Edge:

image

Behavior: no changes when clicking

Chrome/Firefox:

image

Behavior: After several clicks anywhere in the window the popover moves toward the right place. But still arrow is not completely centered as mentioned here: #2089

image

I have noticed that when the width is set explicitly such as
<div class="row no-gutters" style="width: 194px;">
then it looks more as expected but this doesn't seam to be a good solution when content is dynamic.

  1. Another thing I have noticed that might be related to the same issue is position changes on resizing window:
    image

Link to minimally-working plunker that reproduces the issue:

https://stackblitz.com/edit/angular-ipuuur

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 5.2.10

ng-bootstrap: 1.1.2

Bootstrap: 4.1.0

@Arackow
Copy link

Arackow commented Jul 3, 2018

I have the same issue. Mine is just a simple line of text that has different sizes... for my specific use case I can probably just get away with using a fixed width but the solution is probably something to the effect of creating but not rendering the content, measure it, move the popover accordingly, then render...

@maxokorokov maxokorokov removed this from the 2.2.1 milestone Jul 3, 2018
@pkozlowski-opensource pkozlowski-opensource added this to the 3.0.1 milestone Jul 6, 2018
@pkozlowski-opensource pkozlowski-opensource removed this from the 3.0.1 milestone Aug 13, 2018
@yaitskov
Copy link

Explicit style value bothers me also.
It is not even needed. If I disable left property layout fixes itself.

@maxokorokov
Copy link
Member

This should be fixed in 4.0.3, but please see this → #2972 (comment). Feel free to reopen if you're still having issues.

@maxokorokov maxokorokov added this to the 4.0.3 milestone Feb 7, 2019
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

5 participants