Skip to content

Fix nested chiren links in a tags - #91

Merged
adriaandotcom merged 2 commits into
mainfrom
bug/nested-svg
Aug 3, 2026
Merged

Fix nested chiren links in a tags#91
adriaandotcom merged 2 commits into
mainfrom
bug/nested-svg

Conversation

@Maimunar

@Maimunar Maimunar commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #90

Fixes auto-events not firing when a link (<a>) wraps nested elements such as an inline SVG. The delegated click handler previously read event.target, which resolves to the innermost clicked element (e.g. the <svg>/<path>) rather than the anchor, so saAutomatedLink received an element without link properties (href, pathname, hostname) and no event was collected. The handler now passes this, the anchor the listener is bound to, matching the inline onclick path that already uses this.

Changes:

  • fix nested svg bug

Security implications

Has security impact - described as: changes analytics data-collection behavior in the customer-facing tracking script. It is a client-side correctness fix that restores link-click event collection for anchors wrapping nested elements; it does not expose new data, change permissions, or alter data handling beyond restoring the intended tracking.

Testing

Manual testing by the author. Claude review: no automated validation run (node/build commands were not permitted in this environment); change is a one-line, isolated correctness fix in src/auto-events.js, verified by inspection.

Checklist

  • Linked to an issue
  • Tested
  • Asked for a review

@Maimunar
Maimunar requested a review from adriaandotcom July 3, 2026 12:21
@claude claude Bot added the change: needs review Changes affecting security, data protection, or system stability. label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Claude review checkpoint

Reviewed commit c64f371c249709aed72795ebcafafa4f56f53288. This is used to keep later automated reviews focused on changes Claude has not checked yet.

Comment thread src/auto-events.js
@adriaandotcom
adriaandotcom merged commit a87e9e0 into main Aug 3, 2026
6 checks passed
@adriaandotcom
adriaandotcom deleted the bug/nested-svg branch August 3, 2026 16:12
@adriaandotcom

Copy link
Copy Markdown
Collaborator

Reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: needs review Changes affecting security, data protection, or system stability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix nested chiren links in a tags

2 participants