From c4f721eafd52b4fa21415577f76f752d6616d710 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Sun, 9 Jul 2023 15:07:56 +0200 Subject: [PATCH] feat: Append Tooltip to body ...to be able to use it inside e.g. modal without being cut. --- src/components/Tooltip.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Tooltip.ts b/src/components/Tooltip.ts index 3515715..4ba13b3 100644 --- a/src/components/Tooltip.ts +++ b/src/components/Tooltip.ts @@ -3,11 +3,12 @@ import { select } from "d3-selection"; export type Tooltip = ReturnType; export const makeTooltip = (div: HTMLDivElement) => { - const root = select(div) - .selectAll(".tooltip") + const root = select(document.body) + .selectAll(".plotteus-tooltip") .data([null]) .join("div") - .attr("class", "tooltip") + .attr("class", "plotteus-tooltip") + .style("z-index", "999999") .style("position", "fixed") .style("top", 0) .style("left", 0)