[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: allow modifier keys for import links in package code (#1309)

authored by

Bjorn Lu and committed by
GitHub
8ca360f0 e45597ca

+2 -1
+2 -1
app/components/Code/Viewer.vue
··· 62 62 function handleImportLinkNavigate() { 63 63 if (!codeRef.value) return 64 64 65 - const anchors = codeRef.value.querySelectorAll('a.import-link') 65 + const anchors = codeRef.value.querySelectorAll<HTMLAnchorElement>('a.import-link') 66 66 anchors.forEach(anchor => { 67 67 // NOTE: We do not need to remove previous listeners because we re-create the entire HTML content on each html update 68 68 anchor.addEventListener('click', event => { 69 + if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return 69 70 const href = anchor.getAttribute('href') 70 71 if (href) { 71 72 event.preventDefault()