Skip to content

Commit 88e990e

Browse files
authored
Return on link click with ctrl/shift (#2676)
1 parent b1d860e commit 88e990e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/lib/holocene/link.svelte

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
export let light = false;
3333
3434
const onLinkClick = (e: MouseEvent) => {
35-
// Skip if middle mouse click or new tab
36-
if (e.button === 1 || newTab || e.metaKey) return;
35+
if (e.button === 1 || newTab || e.metaKey || e.ctrlKey || e.shiftKey)
36+
return;
37+
3738
e.preventDefault();
3839
goto(href);
3940
};
@@ -42,7 +43,7 @@
4243
<a
4344
{href}
4445
target={newTab ? '_blank' : null}
45-
rel={newTab ? 'noreferrer' : null}
46+
rel={newTab ? 'noreferrer noopener' : null}
4647
class={merge('link', icon ? 'inline-flex' : 'inline', className)}
4748
class:active
4849
class:interactive

0 commit comments

Comments
 (0)