diff --git a/packages/shared/components/article-item/ArticleItem.tsx b/packages/shared/components/article-item/ArticleItem.tsx index 7a256e738a..1f17c6138b 100644 --- a/packages/shared/components/article-item/ArticleItem.tsx +++ b/packages/shared/components/article-item/ArticleItem.tsx @@ -69,10 +69,14 @@ export const ArticleItemPure = (props: ArticleItemProps) => { badgeTitle, } = props; - const onClickAction = (e) => { + const onClickAction = (e: React.MouseEvent) => { onClick?.(e, id); }; + const onMouseDown = (e: React.MouseEvent) => { + if (e.button !== 1) return; + onClickAction(e); + }; const onClickBadgeAction = (e: React.MouseEvent) => { e.stopPropagation(); onClickBadge?.(id); @@ -112,7 +116,7 @@ export const ArticleItemPure = (props: ArticleItemProps) => { isDragActive={isDragActive} onClick={onClickAction} onMouseUp={onMouseUpAction} - onMouseDown={onClickAction} + onMouseDown={onMouseDown} /> diff --git a/packages/shared/components/article/sub-components/DevToolsBar.tsx b/packages/shared/components/article/sub-components/DevToolsBar.tsx index 14b8e589cd..29f8f5de1b 100644 --- a/packages/shared/components/article/sub-components/DevToolsBar.tsx +++ b/packages/shared/components/article/sub-components/DevToolsBar.tsx @@ -49,7 +49,7 @@ const ArticleDevToolsBar = ({ const { t } = useTranslation(["Common"]); const navigate = useNavigate(); - const onClick = (e) => { + const onClick = (e: React.MouseEvent) => { const path = "/portal-settings/developer-tools"; if (openingNewTab(path, e)) return; @@ -60,10 +60,16 @@ const ArticleDevToolsBar = ({ toggleArticleOpen(); }; + const onMouseDown = (e: React.MouseEvent) => { + if (e.button !== 1) return; + + onClick(e); + }; + if (!showText) return null; return ( - + {t("Common:DeveloperTools")} diff --git a/packages/shared/components/article/sub-components/Profile.tsx b/packages/shared/components/article/sub-components/Profile.tsx index 9085ad854b..61771eee2b 100644 --- a/packages/shared/components/article/sub-components/Profile.tsx +++ b/packages/shared/components/article/sub-components/Profile.tsx @@ -89,6 +89,11 @@ const ArticleProfile = (props: ArticleProfileProps) => { onProfileClick?.({ originalEvent: e }); }; + const onNameMouseDownClick = (e: React.MouseEvent) => { + if (e.button !== 1) return; + onNameClick(e); + }; + const onHide = () => { setIsOpen(false); }; @@ -143,7 +148,10 @@ const ArticleProfile = (props: ArticleProfileProps) => { {(!isTabletView || showText) && ( <> - + {firstTerm}   diff --git a/packages/shared/components/avatar/Avatar.tsx b/packages/shared/components/avatar/Avatar.tsx index 461051c8b5..1db43bc5c1 100644 --- a/packages/shared/components/avatar/Avatar.tsx +++ b/packages/shared/components/avatar/Avatar.tsx @@ -157,13 +157,19 @@ const AvatarPure = ({ {content} ); + const onMouseDown = (e: React.MouseEvent) => { + if (e.button !== 1) return; + + if (onClick) onClick(e); + }; + return (