Skip to content

Commit 8ca360f

Browse files
authored
fix: allow modifier keys for import links in package code (#1309)
1 parent e45597c commit 8ca360f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/components/Code/Viewer.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ watch(
6262
function handleImportLinkNavigate() {
6363
if (!codeRef.value) return
6464
65-
const anchors = codeRef.value.querySelectorAll('a.import-link')
65+
const anchors = codeRef.value.querySelectorAll<HTMLAnchorElement>('a.import-link')
6666
anchors.forEach(anchor => {
6767
// NOTE: We do not need to remove previous listeners because we re-create the entire HTML content on each html update
6868
anchor.addEventListener('click', event => {
69+
if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return
6970
const href = anchor.getAttribute('href')
7071
if (href) {
7172
event.preventDefault()

0 commit comments

Comments
 (0)