Allow tooltips to follow the mouse when in popover mode - #39
Open
Pjaerr wants to merge 1 commit into
Open
Conversation
Member
Author
|
馃憢 @amk221 I still need to add tests but raising for you to take an initial look whenever you get a moment |
Pjaerr
commented
Jul 10, 2026
Contributor
|
Looks good thank you!
cheers |
Pjaerr
commented
Jul 24, 2026
Comment on lines
55
to
+66
| get tooltipStyle() { | ||
| const [x, y] = this.tooltipCoords; | ||
| if (!this.args.usePopover) { | ||
| const [x, y] = this.tooltipCoords; | ||
|
|
||
| return htmlSafe(`top: ${y}px; left: ${x}px`); | ||
| return htmlSafe(`top: ${y}px; left: ${x}px`); | ||
| } | ||
|
|
||
| if (this.shouldFollowMouse) { | ||
| return htmlSafe(`translate: var(--offset-x, 0px) var(--offset-y, 0px)`); | ||
| } | ||
|
|
||
| return ''; |
Member
Author
There was a problem hiding this comment.
Not a fan of this, but also not a fan of what it would take to not apply this.tooltipStyle in the template.
Member
Author
There was a problem hiding this comment.
as in I just want to return null from the getter 馃槀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
@followMousearg that, when enabled alongside@usePopover, will make the tooltip follow the mouse, anchored to the axis that matches the edge it is on (ie. if the tooltip is positioned at the top edge of the tooltipper, then it will be moved along the X axis, and if it is positioned at the left edge of the tooltipper, then it will be moved along the Y axis).