From 68997f9a0995e834bf4a8ab00b971d388c548336 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:04:15 +0000 Subject: [PATCH] feat(tooltip): disable on touch devices --- src/ui/Tooltip.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/Tooltip.tsx b/src/ui/Tooltip.tsx index f64905a2..8b4499a9 100644 --- a/src/ui/Tooltip.tsx +++ b/src/ui/Tooltip.tsx @@ -11,6 +11,19 @@ interface TooltipProps { className?: string } +function useIsTouchDevice() { + const [isTouchDevice, setIsTouchDevice] = React.useState(false) + + React.useEffect(() => { + setIsTouchDevice( + window.matchMedia('(hover: none)').matches || + navigator.maxTouchPoints > 0, + ) + }, []) + + return isTouchDevice +} + export function Tooltip({ children, content, @@ -19,7 +32,9 @@ export function Tooltip({ delayDuration = 200, className, }: TooltipProps) { - if (!content) { + const isTouchDevice = useIsTouchDevice() + + if (!content || isTouchDevice) { return <>{children} }