From 7a89fba6d12d79c93c71f9b91368a507bbbf7d7a Mon Sep 17 00:00:00 2001 From: soyalejolopez Date: Wed, 22 Jul 2026 10:30:29 -0500 Subject: [PATCH] Fix upvote button: make it reliably clickable from resource cards The card used a full-card stretched-link overlay (a.resource-link::after, inset:0) sitting under the upvote button. The .card-animate transform creates a stacking context that can let the overlay intercept clicks, navigating to the detail page instead of registering the vote (which looked like the upvote reverted). Removed the overlay and handle whole-card navigation in JS, skipping .vote-btn clicks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8379305..49043a0 100644 --- a/index.html +++ b/index.html @@ -1133,7 +1133,7 @@ text-overflow: ellipsis; } .card-title a { color: inherit; text-decoration: none; } - .card-title a.resource-link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); z-index: 1; } + /* Whole-card navigation is handled in JS (see click handler) so the upvote button and other controls stay reliably clickable. */ .card-sub { display: inline-flex; @@ -1750,7 +1750,9 @@

Related resources

}); document.addEventListener('click', (e) => { - const link = e.target.closest('a.resource-link'); + if (e.target.closest('.vote-btn')) return; + const card = e.target.closest('.card'); + const link = (card && card.querySelector('a.resource-link')) || e.target.closest('a.resource-link'); if (link && !e.ctrlKey && !e.metaKey && !e.shiftKey) { e.preventDefault(); const url = new URL(link.href, window.location.origin);