-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
Tooltips auto placement calculates available space wrongly. #13897
Comments
Testing the version from bbcea1d8d5f03eaa480e42bd6812cee22a087893 before submitting twbs/bootstrap#13897.
Please provide a live example on JS Bin demonstrating the problem. |
http://jsbin.com/tavewami/1/edit?html,js,output Note that the "auto" placement moves the tooltip over to the left, unnecessarily. It would fit on the right. |
Still an issue in v3.2.0: http://jsbin.com/fifosile/4/ |
@RR2DO2 has fixed this in #12284: http://jsbin.com/tavewami/2 |
Due to the switch to Bootstrap 3.2 in this version, tooltip auto placement works erroneously (see twbs/bootstrap#13897). This is a workaround, waiting for a fix in Bootstrap assets. (Closes #1341)
I'm guessing this is related to an issue I'm having? I want the tooltips to show up to the right of my text unless there is not enough space. So according to my understanding of the documentation I should use But when I use Does this bug (and/or #15367) explain the behavior I see, or am I experiencing a different issue? |
Punting as a won't fix—v4 includes a new positioning library for our affix, tooltips, and popovers. |
If the tooltip is positioned "auto right", then it assumes that its own left + width must be less than the parent width, otherwise it switches to the alternate position:
However that's not actually true because it ignores the position of the parent (specifically its left offset). Thus it's easy for the tooltip to think there's not enough space when there is.
For example, if you look at the attached screenshot you can see that:
The tooltip should be to the right of the "Add/Remove" button, and clearly there is space: pos.right + actualWidth = 999, while parentDim.right = 1177. However the calculation uses parentDim.width instead of parentDim.right, ignoring the left offset of the parent, so it thinks there isn't enough space.
The text was updated successfully, but these errors were encountered: