Fix: Cmd-clicking page linking

This commit is contained in:
Zef Hemel
2026-05-27 15:00:12 +02:00
parent a7f2a5ea96
commit 89a9b5ce99
+4 -5
View File
@@ -69,12 +69,11 @@ export function attachWidgetEventHandlers(
// Override wiki links with local navigate (faster)
div.querySelectorAll("a[data-ref]").forEach((el_) => {
const el = el_ as HTMLElement;
// Override default click behavior with a local navigate (faster)
// Override default click behavior with a local navigate (faster).
// Ctrl/meta-click navigates in a new window: we can't rely on the
// browser's native "open in new tab" for the anchor's href, because
// inside the desktop app's webview that just navigates in place.
el.addEventListener("click", (e) => {
if (e.ctrlKey || e.metaKey) {
// Don't do anything special for ctrl/meta clicks
return;
}
e.preventDefault();
e.stopPropagation();
void client.navigate(