From a3ee21d7fc16c47315d2fa071344eaa6be2f1223 Mon Sep 17 00:00:00 2001 From: Sebastian Holmqvist <1297882+csholmq@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:39:42 +0200 Subject: [PATCH] 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 --- packages/mermaid/src/diagrams/flowchart/flowDb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 501479239b..f224c9bace 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -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(/<br\/>/g, '
')); el.classed('hover', true); })