-
-
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
Tooltip arrow fixes #13718
Tooltip arrow fixes #13718
Conversation
Perhaps something like |
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '') | ||
Tooltip.prototype.replaceArrow = function (delta, dimension, rightLeft) { | ||
this.arrow() | ||
.css(rightLeft ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why'd you remove the delta
-related ternary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because if delta is zero it removes the css value, which resets it to 50%, but if delta is zero it will always be 50% anyway.
how about |
This also appears to fix #13384. |
makes sense to me. (also i'm a fan of @peterjwest do you think you could a unit test to make sure we dont see any regressions around this fix? Would be really great to get one |
Would be happy to, I'm out of the country for a week though. |
cool, no rush. thanks! :) |
@peterjwest Any updates on this? |
Sorry, I'll get on this ASAP :) |
@peterjwest Nice, thanks for the great work! |
@peterjwest Friendly ping on this. |
These changes fixed my issue with tooltip arrow placement on wrapped labels, thank you! |
This also appears to solve #13696 |
Hi |
@Arkni Presumably yes, as popovers are basically just fancy tooltips. The functions relevant to arrow placement don't differ between the popover plugin and the tooltip plugin. See also this fiddle. |
Yes it should if it's the same issue, I created it because I had an issue with popovers :) |
@hnrch02 @peterjwest Thanks a lot, it works perfectly 👍 |
Fixes twbs#13696. Fixes twbs#13696. Fixes twbs#14197. Closes twbs#13718.
Thanks for this! Solves the problem! |
This fixes two bugs in the tooltips plugin:
delta.left
value returned bygetCalculatedOffset
, however there are cases when this value is 0, but the placement of the plugin is still top or bottom, which means the arrow should be positioned using theleft
property. This fix uses the existingplacement
variable (fixes Tooltip arrow not positioned correctly when offset is adjusted and placement is top or bottom #13696)