From 2630e964d034bb4fa62cf07031c96697e82458d4 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 29 Mar 2024 13:14:05 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20make=20sure=20tooltip=20IDs=20ar?= =?UTF-8?q?e=20unique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/src/components/HeaderButtonWithText.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gui/src/components/HeaderButtonWithText.tsx b/gui/src/components/HeaderButtonWithText.tsx index bc97c287a..b1b4f5241 100644 --- a/gui/src/components/HeaderButtonWithText.tsx +++ b/gui/src/components/HeaderButtonWithText.tsx @@ -1,6 +1,8 @@ import React, { useState } from "react"; -import { HeaderButton, StyledTooltip } from "."; import ReactDOM from "react-dom"; +import { HeaderButton, StyledTooltip } from "."; + +import { v4 as uuidv4 } from "uuid"; interface HeaderButtonWithTextProps { text: string; @@ -20,13 +22,14 @@ const HeaderButtonWithText = React.forwardRef< HeaderButtonWithTextProps >((props: HeaderButtonWithTextProps, ref) => { const [hover, setHover] = useState(false); + const id = uuidv4(); const tooltipPortalDiv = document.getElementById("tooltip-portal-div"); return ( <> { @@ -48,10 +51,10 @@ const HeaderButtonWithText = React.forwardRef< {tooltipPortalDiv && ReactDOM.createPortal( - + {props.text} , - tooltipPortalDiv + tooltipPortalDiv, )} );