diff --git a/src/index.tsx b/src/index.tsx index a48e0e4..f0e9e50 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,6 +5,8 @@ /* eslint-disable prefer-const */ /* eslint-disable quotes */ +"use client" + import * as PropTypes from 'prop-types'; import * as React from 'react'; import * as NProgress from 'nprogress'; @@ -227,6 +229,7 @@ const NextTopLoader = ({ const target = event.target as HTMLElement; const anchor = findClosestAnchor(target); const newUrl = anchor?.href; + const isNewTab = event.ctrlKey || event.metaKey; if (newUrl) { const currentUrl = window.location.href; // const newUrl = (anchor as HTMLAnchorElement).href; @@ -249,6 +252,7 @@ const NextTopLoader = ({ isSpecialScheme || event.ctrlKey || event.metaKey || + isNewTab event.shiftKey || event.altKey || isHashAnchor(window.location.href, anchor.href) ||