TagSpaces is an offline, open source, document manager with tagging support
chore: Skip tooltips outside desktop mode
Ilian Sapundshiev9c1f3ab9ec4c
diff --git a/src/renderer/components/TsTooltip.tsx b/src/renderer/components/TsTooltip.tsxindex edc77f43a..4ae3e448c 100644--- a/src/renderer/components/TsTooltip.tsx+++ b/src/renderer/components/TsTooltip.tsx@@ -18,7 +18,9 @@import AppConfig from '-/AppConfig';import { adjustKeyBinding } from '-/components/dialogs/KeyboardDialog';+import { isDesktopMode } from '-/reducers/settings';import Tooltip, { TooltipProps } from '@mui/material/Tooltip';+import { useSelector } from 'react-redux';export type TsTooltipProps = Omit<TooltipProps, 'title'> & {title: React.ReactNode;@@ -35,6 +37,13 @@ function TsTooltip(props: TsTooltipProps) {arrow = true,...rest} = props;+ // Skip tooltips outside desktop mode: on touch-first layouts they fire on+ // tap/long-press and get in the way. Gating on desktop mode (not the native+ // platform) keeps them for an iPad with a keyboard, where they make sense.+ const desktopMode = useSelector(isDesktopMode);+ if (!desktopMode) {+ return <>{rest.children}</>;+ }const tooltipText = keyBinding? `${title} (${adjustKeyBinding(keyBinding)})`: title;