diff --git a/src/layouts/rest-api/category/index.tsx b/src/layouts/rest-api/category/index.tsx index 58d5c0c24..03019ab36 100644 --- a/src/layouts/rest-api/category/index.tsx +++ b/src/layouts/rest-api/category/index.tsx @@ -101,6 +101,13 @@ export function Category(props: CategoryProps) { "opacity-50": endpoint.deprecated || endpoint.unstable, }} onClick={(e) => { + if ( + e.ctrlKey || + e.metaKey || + e.shiftKey || + e.button !== 0 + ) + return; e.preventDefault(); expandAndScrollTo({ section: props.section, diff --git a/src/layouts/rest-api/category/type-def.tsx b/src/layouts/rest-api/category/type-def.tsx index fb8ed1989..b4f58b5ab 100644 --- a/src/layouts/rest-api/category/type-def.tsx +++ b/src/layouts/rest-api/category/type-def.tsx @@ -66,6 +66,8 @@ export function TypeDefinitions(props: TypeDefinitionsProps) { class="underline-offset-4 transition-colors hover:text-orange-5 hover:underline" href={href} onClick={(e) => { + if (e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) + return; e.preventDefault(); expandAndScrollTo({ section: "type-def", @@ -510,6 +512,7 @@ function TypeReprDoc(props: TypeReprDocProps) { class="inline-block text-green-6 font-bold underline-offset-4 transition-colors hover:text-orange-5 hover:underline" href={href()} onClick={(e) => { + if (e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) return; e.preventDefault(); expandAndScrollTo({ section: "type-def", diff --git a/src/layouts/rest-api/misc/ApiLink.tsx b/src/layouts/rest-api/misc/ApiLink.tsx index b80b192dc..478199f5e 100644 --- a/src/layouts/rest-api/misc/ApiLink.tsx +++ b/src/layouts/rest-api/misc/ApiLink.tsx @@ -19,13 +19,12 @@ export default function ApiLink({ }: ApiLinkProps) { const id = getEndpointRepr({ method, path }); const href = `${basepath}/${section}#${encodeURIComponent(id)}`; - const className = - "hover:text-orange-5 hover:border-orange-2 border-b-2 transition-colors"; return ( { + if (e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) return; e.preventDefault(); expandAndScrollTo({ section, href, id }); }}