mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: ctrl key functionality
This commit is contained in:
1 parent
84929f9732
commit
03aa690247
1 file changed
+7
-1
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user