Skip to content

Fix token popup link clicks triggering input blur#4958

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-learn-more-link
Draft

Fix token popup link clicks triggering input blur#4958
Copilot wants to merge 4 commits intomainfrom
copilot/fix-learn-more-link

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Clicking links in the token format popup (e.g., "Learn more") was closing the popup instead of navigating. The input blur handler fires before the click completes, hiding the popup prematurely.

Changes

  • Added mousedown handler to popup element that prevents default for anchor tags
  • Preserves focus on input while allowing link navigation
  • Uses case-insensitive tag check (toUpperCase()) for DOM compatibility
$popup.addEventListener('mousedown', (e) => {
    const target = e.target as HTMLElement;
    if (target.tagName?.toUpperCase() === 'A' || target.closest('a')) {
        e.preventDefault();
    }
});

Handler registered once during popup content initialization to avoid duplicate listeners.

Original prompt

This section details on the original issue you should resolve

<issue_title>Cannot click "Learn more" in GitLens setting popup</issue_title>
<issue_description>When setting the Inline Blame "Annotation format," the "Learn more" link at the bottom of the popover cannot be clicked.

Code

Clicking the link instead closes the popover.

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 4, 2026 23:46
Co-authored-by: d13 <293282+d13@users.noreply.github.com>
Co-authored-by: d13 <293282+d13@users.noreply.github.com>
Co-authored-by: d13 <293282+d13@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix non-clickable Learn more link in GitLens settings Fix token popup link clicks triggering input blur Feb 4, 2026
Copilot AI requested a review from d13 February 4, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot click "Learn more" in GitLens setting popup

2 participants