From 76fd3342a38d5cfeb0031ab9fd4a395ac6883b66 Mon Sep 17 00:00:00 2001 From: bluwy Date: Tue, 10 Feb 2026 10:30:20 +0800 Subject: [PATCH] fix: allow modifier keys for import links in package code --- app/components/Code/Viewer.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/Code/Viewer.vue b/app/components/Code/Viewer.vue index 2d9fe7811..6f6e82a5f 100644 --- a/app/components/Code/Viewer.vue +++ b/app/components/Code/Viewer.vue @@ -62,10 +62,11 @@ watch( function handleImportLinkNavigate() { if (!codeRef.value) return - const anchors = codeRef.value.querySelectorAll('a.import-link') + const anchors = codeRef.value.querySelectorAll('a.import-link') anchors.forEach(anchor => { // NOTE: We do not need to remove previous listeners because we re-create the entire HTML content on each html update anchor.addEventListener('click', event => { + if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return const href = anchor.getAttribute('href') if (href) { event.preventDefault()