Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 1ef80ff

Browse files
authored
Fixed CTRL+LMB clicking links (#20)
* Fixed `CTRL+LMB` clicking links * Updated CHANGELOG.md
1 parent 5d5752a commit 1ef80ff

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ This project tries to follow [SemVer 2.0.0](https://semver.org/).
2727
- Fixed links to open in new tab via `target="_blank"` instead of the invalid
2828
value `target="about:blank"`. (#17)
2929

30+
- Fixed issue where `Ctrl` + left mouse button clicking a link did not open the
31+
link in a new tab. (#20)
32+
3033
## v1.1.0 (2021-10-04)
3134

3235
- Changed from `.mp3` files to `.ogg` files, reducing the size down to almost

src/Link.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$: isCurrent = href.startsWith("?") && search === href;
1515
1616
function onclick(e: MouseEvent) {
17-
if (href.startsWith("?") && window.history?.pushState) {
17+
if (!e.ctrlKey && href.startsWith("?") && window.history?.pushState) {
1818
e.preventDefault();
1919
window.history.pushState(null, href, href);
2020
window.dispatchEvent(new PopStateEvent("onpushstate", { state: null }));

0 commit comments

Comments
 (0)