-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] anchor tag inside svg #2286
Conversation
🦋 Changeset detectedLatest commit: e1f23b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the formatting issues Ben pointed out, code lgtm.
It would be nice if these had some accompanying tests |
Looks like spaces and tabs are being mixed too. we'll need to normalize/format them as well |
I can clean up the formatting easily enough. I'll need some guidance regarding tests, though. I'm not sure where to begin with that. |
You can try and take a look at the examples in |
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
With anchor tags inside SVG elements, the href attribute is an object. The href value is at a.href.baseVal. However, this value differs from a normal anchor tag, in that it is not the full resolved path, so in order to pass it to a URL constructor, you have to include a base URL. This change handles SVG anchor tags correctly, including prefetch, and in the click event handler function.
Fixes #2256