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

Misaligned popover arrows #25045

Closed
simonihmig opened this issue Dec 20, 2017 · 3 comments
Closed

Misaligned popover arrows #25045

simonihmig opened this issue Dec 20, 2017 · 3 comments
Labels

Comments

@simonihmig
Copy link
Contributor

Seems similar to #23793, although I could not reproduce the issue for tooltips, but indeed for popovers.

Here is a demo: https://codepen.io/simonihmig/pen/WdxXja. The first button triggers a popover, where you can clearly see that the arrow is misaligned.

It has left: 132px applied by popper.js. However the popover itself has a width of 276px, so the center should rather be 137px. And indeed if I set this manually to this value or left: 50% in Chrome Dev Tools, then it is perfectly aligned! So somewhere this 5px offset is causing the misalignment.

@Johann-S
Copy link
Member

Johann-S commented Dec 21, 2017

Marked as css because as you can see here :

image

Our arrow element is in the right place but due to our CSS it's not correctly centered

@simonihmig
Copy link
Contributor Author

Right! Popper positions this correctly, just the pseudo elements (responsible for rendering the actual arrow) should be aligned to the center of .arrow, not the left edge! (or .arrow should have a zero width?)

@alecpl
Copy link
Contributor

alecpl commented Dec 21, 2017

Possible fix:

[...] .popover.bs-popover-bottom .arrow::before {
    margin-left: calc((.8rem/2 + 1px) * -1);
}

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

No branches or pull requests

3 participants