diff --git a/apps/web/src/components/Button/ButtonWithLink.tsx b/apps/web/src/components/Button/ButtonWithLink.tsx index 2742905073e..9f3fed22d16 100644 --- a/apps/web/src/components/Button/ButtonWithLink.tsx +++ b/apps/web/src/components/Button/ButtonWithLink.tsx @@ -29,11 +29,16 @@ export function ButtonWithLink({ ...buttonProps }: ButtonWithLinkProps) { +// If the link opens in a new tab and no rel is specified, +// default to "noopener noreferrer" to prevent tab-nabbing. +const computedRel = + rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined); + return ( @@ -52,3 +57,4 @@ export function ButtonWithLink({ ); } +