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

Using an array for "options.distance" prevents the position of the tooltip to be correct #802

Closed
mcarlier-r7 opened this issue May 24, 2020 · 2 comments

Comments

@mcarlier-r7
Copy link

Hello,

First of all, thank you for your hard work on this plugin.

It seems that there is an issue with the calculation of the tooltip's position when the options.distance is an array.

Please take a look at those examples: https://jsfiddle.net/muhfv5gq/1/.
If the options.distance is an array of 4 items, or if it's an array of 3 or fewer items and any option is updated using .option(), the position of the tooltip is not calculated correctly.

It looks like it's related to this logic: https://github.com/iamceege/tooltipster/blob/f818f589de54165209756aa3319f49f841d708a2/src/js/plugins/tooltipster/sideTip/tooltipster-sideTip.js#L185-L197
If self.__options.distance has a length of 4, it doesn't get assigned to an object with the correct properties.

Thank you for looking into it!

@gavin310
Copy link

gavin310 commented Jun 5, 2020

I actually just had this same issue. It seems to work correctly if you define distance as an object like: distance: { top: 20, bottom: 20, left: -40, right: -110 }.

@louisameline
Copy link
Collaborator

Thank you very much for your comments and for identifying the bad line.
It should be fixed now in v4.2.8.
Have a nice day!

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

No branches or pull requests

3 participants