Skip to content

Commit

Permalink
fix(gatsby-plugin-catch-links): handle SVGAnimatedString href values (#…
Browse files Browse the repository at this point in the history
…9829)

Updates `gatsby-plugin-catch-links` to handle SVG anchors.

Fixes #9816
  • Loading branch information
Bassetts authored and DSchau committed Nov 9, 2018
1 parent f54ada4 commit 4538ff3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-catch-links/src/catch-links.js
Expand Up @@ -119,6 +119,9 @@ export const routeThroughBrowserOrApp = hrefHandler => event => {
// in React. Creating a new anchor element to ensure host value is present
const destination = document.createElement(`a`)
destination.href = clickedAnchor.href
if (clickedAnchor.href instanceof SVGAnimatedString) {
destination.href = clickedAnchor.href.animVal
}

// In IE, the default port is included in the anchor host but excluded from
// the location host. This affects the ability to directly compare
Expand Down

0 comments on commit 4538ff3

Please sign in to comment.