mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +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}
|
href={href}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (href) router.push(href);
|
if (href) {
|
||||||
|
if (event.ctrlKey || event.metaKey) {
|
||||||
|
window.open(href);
|
||||||
|
} else {
|
||||||
|
router.push(href);
|
||||||
|
}
|
||||||
|
}
|
||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
}}
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in new issue
Block a user