Skip to content

Commit

Permalink
fix(tooltip): change position of tooltip to not cover node
Browse files Browse the repository at this point in the history
Position the tooltip centered, just below the node being hovered.

Update packages/mermaid/src/diagrams/flowchart/flowDb.js

Co-authored-by: Sidharth Vinod <[email protected]>
  • Loading branch information
2 people authored and Sebastian Holmqvist committed Oct 31, 2023
1 parent 8f2a506 commit a3ee21d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/flowchart/flowDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ const setupToolTips = function (element) {
tooltipElem
.text(el.attr('title'))
.style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px')
.style('top', window.scrollY + rect.top - 14 + 'px');
.style('top', window.scrollY + rect.bottom + 'px');
tooltipElem.html(tooltipElem.html().replace(/&lt;br\/&gt;/g, '<br/>'));
el.classed('hover', true);
})
Expand Down

0 comments on commit a3ee21d

Please sign in to comment.