diff --git a/packages/web/src/javascripts/Components/StyledTooltip/StyledTooltip.tsx b/packages/web/src/javascripts/Components/StyledTooltip/StyledTooltip.tsx index 850a97bf253..a3b64249430 100644 --- a/packages/web/src/javascripts/Components/StyledTooltip/StyledTooltip.tsx +++ b/packages/web/src/javascripts/Components/StyledTooltip/StyledTooltip.tsx @@ -1,5 +1,5 @@ import { classNames } from '@standardnotes/snjs' -import { ReactNode, useState, useRef, useEffect, MouseEvent } from 'react' +import { ReactNode, useState, useRef, useEffect } from 'react' import { Tooltip, TooltipAnchor, TooltipOptions, useTooltipStore } from '@ariakit/react' import { Slot } from '@radix-ui/react-slot' import { MutuallyExclusiveMediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery' @@ -57,6 +57,12 @@ const StyledTooltip = ({ } }, [attachLongPressEvents, cleanupLongPressEvents, isMobile, showOnMobile]) + const clickProps = isMobile + ? {} + : { + onClick: () => setForceOpen(false), + } + if (isMobile && !showOnMobile) { return <>{children} } @@ -65,12 +71,7 @@ const StyledTooltip = ({ <> setForceOpen(false)} - onContextMenu={(event: MouseEvent) => { - if (isMobile && showOnMobile) { - event.preventDefault() - } - }} + {...clickProps} onBlur={() => setForceOpen(undefined)} store={tooltip} as={Slot} diff --git a/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugins/MobileToolbarPlugin.tsx b/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugins/MobileToolbarPlugin.tsx index 48b9505660a..81db5119b58 100644 --- a/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugins/MobileToolbarPlugin.tsx +++ b/packages/web/src/javascripts/Components/SuperEditor/Plugins/ToolbarPlugins/MobileToolbarPlugin.tsx @@ -408,7 +408,14 @@ const MobileToolbarPlugin = () => {