Skip to content

Commit 76fd334

Browse files
committed
fix: allow modifier keys for import links in package code
1 parent 299a877 commit 76fd334

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)