Fix 'Go to Project' button link by separating IssueList from outer an… - #740
Open
ubaidurrehman-developer wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem Description
On project cards that have
loadIssues: trueenabled (activist.org,CircuitVerse, andOpensourcedesign), hovering over or clicking the "Go to Project" button did not work as a link and did not display a pointer cursor (cursor: pointer).🔍 Root Cause Analysis
In
src/components/ProjectCard.astro, the entire project card was wrapped in a top-level anchor tag (<a class="Card-Real-Link">). WhenloadIssues: trueis enabled,<IssueList />renders individual GitHub issue links using<a>tags inside the card body.According to HTML specifications, nesting
<a>tags inside<a>tags is invalid HTML. Browser DOM parsers automatically auto-closed the parent<a class="Card-Real-Link">before rendering the inner issue links. This ejected<div class="Card-Link"><span>Go to Project</span></div>outside of the anchor element in the DOM tree, causing it to lose its hyperlink functionality and pointer cursor styling.🛠️ Changes Made
src/components/ProjectCard.astro:<a class="Card-Real-Link" href={projectLink} target="_blank">.{loadIssues && <IssueList />}into<div class="Card-Issues-Wrapper">, rendering it outside of any parent<a>element.<a class="Card-Link" href={projectLink} target="_blank">.cursor: pointerbehavior.✅ Verification
<a>tags.cursor: pointerand opens project link when clicked on cards withloadIssues: true.<IssueList />remain independently clickable.