diff --git a/app/soapbox/components/status_content.tsx b/app/soapbox/components/status_content.tsx index ef53d55a0..9cbafa67f 100644 --- a/app/soapbox/components/status_content.tsx +++ b/app/soapbox/components/status_content.tsx @@ -87,6 +87,7 @@ const StatusContent: React.FC = ({ status, expanded = false, onE const onMentionClick = (mention: Mention, e: MouseEvent) => { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); + e.stopPropagation(); history.push(`/@${mention.acct}`); } }; @@ -96,10 +97,16 @@ const StatusContent: React.FC = ({ status, expanded = false, onE if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); + e.stopPropagation(); history.push(`/tags/${hashtag}`); } }; + /** For regular links, just stop propogation */ + const onLinkClick = (e: MouseEvent) => { + e.stopPropagation(); + }; + const updateStatusLinks = () => { if (!node.current) return; @@ -124,6 +131,7 @@ const StatusContent: React.FC = ({ status, expanded = false, onE link.addEventListener('click', onHashtagClick.bind(link, link.text), false); } else { link.setAttribute('title', link.href); + link.addEventListener('click', onLinkClick.bind(link), false); } }); }; diff --git a/app/soapbox/features/status/components/card.js b/app/soapbox/features/status/components/card.js index ac933ff42..f556ae3c8 100644 --- a/app/soapbox/features/status/components/card.js +++ b/app/soapbox/features/status/components/card.js @@ -252,7 +252,14 @@ export default class Card extends React.PureComponent { } return ( - + e.stopPropagation()} + > {embed} {description}