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

Changing min-width on the tooltip causes left to be wrong #398

Closed
davideoliveri opened this issue Feb 9, 2015 · 2 comments
Closed

Changing min-width on the tooltip causes left to be wrong #398

davideoliveri opened this issue Feb 9, 2015 · 2 comments
Labels

Comments

@davideoliveri
Copy link

EDIT:
I've changed the title because I discovered a broader issue which is not related with rendering outside of the view any-more, instead, the left value of the tooltip is wrong whenever apllying a different min-width to the tooltip, see image below.
introjs bad measuring

In the option I've set to add a class on every tooltip. This class has a min-width set to 400px.
This causes the tooltip to render outside of the view.

I've tried #210 solution bit it seems like if the calculation are made without considering the new width. Removing the class solve the issue.

What if I wanted a wider tooltip?
I am more than sure I'm missing something but I need directions here, please.

@davideoliveri davideoliveri changed the title Changing min-width on the tooltip causes left to be negative and render outside of the view Changing min-width on the tooltip causes left to be wrong Feb 9, 2015
@davideoliveri
Copy link
Author

A workaround, besides changes inside the function as suggested in #210 is to change a line inside the _placeTooltip() function, at line 532

from

tooltipLayer.style.left = (_getOffset(targetElement).width / 2 - _getOffset(tooltipLayer).width / 2) + 'px';

to

tooltipLayer.style.left = '0px';

This is solving my particular issue, but who knows if it will break something else.

@stale
Copy link

stale bot commented Oct 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 13, 2020
@stale stale bot closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant