-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Automatic popover arrow placement #22669
Comments
Thank you @alecpl for your feedback 👍 |
It's as simple as creating a popover for a button that is on the right side of the screen. Something like:
and make sure the popover does not wrap the content text so it's much wider than the button. |
So I made a Codepen to demonstrate what you reported @alecpl see : https://codepen.io/Johann-S/pen/dWwQyX The first button is our current dist of Bootstrap |
@Johann-S Thanks for working on this. Popover2's popover position is out of screen, that's what I see. And arrow is in the middle, which is also wrong. The first button displays popover in a correct position only the arrow position is wrong. So, x-arrow here somehow broke the popover positioning nothing more. |
Maybe @FezVrasta can help us on that issue ? About the positionning of the arrow by Popper.js |
@Johann-S aside of the popover position issue (popper.js bug?) I see it set |
@Johann-S The problem is that you are positioning with CSS the It expects the arrow to have a width, but in Bootstrap the An easy fix is to simply get rid of any positioning applied to the .arrow {
position: absolute;
width: 22px;
height: 11px;
} https://codepen.io/FezVrasta/pen/oWJJYd You will want to address the 4 base placements like I do in the Popper.js demo website: |
Using the latest build based on Popper.js I don't see how to automatically place the popover arrow. When the button is on an edge of the screen the arrow is still in the middle of the popover.
I see in the Popper demos it can position the arrow properly, so this is Bootstrap specific issue. Because the arrow uses :after selector it might be tricky to fix it programmatically. I suppose arrow positioning should be delegated to Popper.
The text was updated successfully, but these errors were encountered: