From 3d40ed5d474305ea66c515e619900d2a22e472bc Mon Sep 17 00:00:00 2001 From: spacebares <57186372+spacebares@users.noreply.github.com> Date: Wed, 28 Jun 2023 06:45:54 -0400 Subject: [PATCH] fix tooltip not showing if too far left (#6909) --- web/src/components/Tooltip.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/Tooltip.jsx b/web/src/components/Tooltip.jsx index ba56f20b8..58f723ac5 100644 --- a/web/src/components/Tooltip.jsx +++ b/web/src/components/Tooltip.jsx @@ -29,7 +29,7 @@ export default function Tooltip({ relativeTo, text }) { let newLeft = left - Math.round(tipWidth / 2); // too far right if (newLeft + tipWidth + TIP_SPACE > windowWidth - window.scrollX) { - newLeft = left - tipWidth - TIP_SPACE; + newLeft = Math.max(0, left - tipWidth - TIP_SPACE); newTop = top - Math.round(tipHeight / 2); } // too far left