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

Tooltip Position is wrong if useMaxWidth = false and you scroll #542

Closed
renierr opened this issue Jun 14, 2017 · 4 comments
Closed

Tooltip Position is wrong if useMaxWidth = false and you scroll #542

renierr opened this issue Jun 14, 2017 · 4 comments
Labels
Type: New Shape Request for new shape

Comments

@renierr
Copy link

renierr commented Jun 14, 2017

if you set useMaxWidth to false and render a large graph where you able to scoll.
The Tooltip position is wronmg if you scroll left/right or up/down

I solved this by setting the CSS style for tooltip to 'fixed' and changed the added scroll top position in JS

from:
tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');

to:
tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + 'px');

@ziyiwang
Copy link

ziyiwang commented Oct 5, 2017

Hi
the above didnt work for me

changing to this worked

tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.scrollingElement.scrollTop + 'px');

@vnijs
Copy link

vnijs commented Dec 30, 2017

@ziyiwang's response seems to address the issue with tooltip placement after zooming (#388) and scrolling

@stale
Copy link

stale bot commented Jun 29, 2019

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 Type: New Shape Request for new shape label Jun 29, 2019
mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
@minheeDitto
Copy link

In the flowChart subgraph add the local image,the node can not adjust,such as B[the product unit],how to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Shape Request for new shape
Projects
None yet
Development

No branches or pull requests

4 participants