diff --git a/packages/core/src/shouldIntercept.ts b/packages/core/src/shouldIntercept.ts index c46b9b5c2..42c61fb40 100644 --- a/packages/core/src/shouldIntercept.ts +++ b/packages/core/src/shouldIntercept.ts @@ -3,7 +3,6 @@ export default function shouldIntercept(event: MouseEvent | KeyboardEvent): bool return !( (event.target && (event?.target as HTMLElement).isContentEditable) || event.defaultPrevented || - (isLink && event.which > 1) || (isLink && event.altKey) || (isLink && event.ctrlKey) || (isLink && event.metaKey) || diff --git a/packages/react/src/Link.ts b/packages/react/src/Link.ts index 061b7792c..5d29b01f8 100755 --- a/packages/react/src/Link.ts +++ b/packages/react/src/Link.ts @@ -17,7 +17,7 @@ interface BaseInertiaLinkProps { href: string method?: Method headers?: Record - onClick?: (event: React.MouseEvent) => void + onClick?: (event: React.MouseEvent) => void preserveScroll?: PreserveStateOption preserveState?: PreserveStateOption replace?: boolean @@ -67,10 +67,10 @@ const Link = forwardRef( ref, ) => { const visit = useCallback( - (event) => { + (event: React.MouseEvent) => { onClick(event) - if (shouldIntercept(event)) { + if (shouldIntercept(event.nativeEvent)) { event.preventDefault() router.visit(href, {