diff --git a/src/components/middle/message/hooks/useOuterHandlers.ts b/src/components/middle/message/hooks/useOuterHandlers.ts index cda25722..914ba733 100644 --- a/src/components/middle/message/hooks/useOuterHandlers.ts +++ b/src/components/middle/message/hooks/useOuterHandlers.ts @@ -54,6 +54,11 @@ export default function useOuterHandlers( function handleContextMenu(e: React.MouseEvent) { if (IS_ANDROID) { + if (!(e.target as HTMLElement).matches('a[href]')) { + return; + } + + e.preventDefault(); selectMessage(); } else { onContextMenu(e); diff --git a/src/hooks/useContextMenuHandlers.ts b/src/hooks/useContextMenuHandlers.ts index ed264429..191946b4 100644 --- a/src/hooks/useContextMenuHandlers.ts +++ b/src/hooks/useContextMenuHandlers.ts @@ -32,7 +32,7 @@ export default ( const handleContextMenu = useCallback((e: React.MouseEvent) => { document.body.classList.remove('no-selection'); - if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a.text-entity-link[href]'))) { + if (isMenuDisabled || (shouldDisableOnLink && (e.target as HTMLElement).matches('a[href]'))) { return; } e.preventDefault(); @@ -91,7 +91,7 @@ export default ( const { clientX, clientY, target } = originalEvent.touches[0]; - if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a.text-entity-link[href]'))) { + if (contextMenuPosition || (shouldDisableOnLink && (target as HTMLElement).matches('a[href]'))) { return; }