fix(tooltip): change position of tooltip to not cover node

Position the tooltip centered, just below the node being hovered.

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

Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
This commit is contained in:
Sebastian Holmqvist 2023-10-20 08:39:42 +02:00 committed by Sebastian Holmqvist
parent 8f2a5064cb
commit a3ee21d7fc
1 changed files with 1 additions and 1 deletions

View File

@ -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);
})