From 74eea8fe866bae68a26a20f3728d3f0aedb435c3 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 2 Aug 2026 16:53:36 -0700 Subject: [PATCH] =?UTF-8?q?Make=20it=20so=20that=20tapping=20an=20image=20?= =?UTF-8?q?that=E2=80=99s=20a=20link=20navigates=20to=20the=20link.=20(Doe?= =?UTF-8?q?sn=E2=80=99t=20zoom=20the=20image.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Resources/main_ios.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iOS/Resources/main_ios.js b/iOS/Resources/main_ios.js index 37f7f31a8..e54685859 100644 --- a/iOS/Resources/main_ios.js +++ b/iOS/Resources/main_ios.js @@ -96,9 +96,12 @@ class ImageViewer { // Add the click listener for images window.onclick = function(event) { if (event.target.matches("img") && !event.target.classList.contains("nnw-nozoom")) { - // Without this, tapping an image wrapped in a link also navigates. - // - event.preventDefault(); + // An image inside a link navigates — it might be the only link to an + // important page. Zoom only standalone images. + // + if (event.target.closest("a[href]")) { + return; + } if (activeImageViewer && activeImageViewer.img === event.target) { cancelImageLoad(); } else {