fix: ctrl key functionality

This commit is contained in:
TrèsAbhi committed 2024-06-13 13:50:44 -05:00
1 parent 84929f9732
commit 03aa690247
1 file changed
+7 -1
+7 -1
View File
@@ -11,7 +11,13 @@ export function Link({ href, onClick, ...props }: LinkProps) {
href={href}
onClick={(event) => {
event.preventDefault();
if (href) router.push(href);
if (href) {
if (event.ctrlKey || event.metaKey) {
window.open(href);
} else {
router.push(href);
}
}
onClick?.(event);
}}
{...props}