From 4538ff32cad3bedbc14ea81c34acab9fc52422aa Mon Sep 17 00:00:00 2001 From: Jason Liquorish Date: Fri, 9 Nov 2018 00:16:12 +0000 Subject: [PATCH] fix(gatsby-plugin-catch-links): handle SVGAnimatedString href values (#9829) Updates `gatsby-plugin-catch-links` to handle SVG anchors. Fixes #9816 --- packages/gatsby-plugin-catch-links/src/catch-links.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/gatsby-plugin-catch-links/src/catch-links.js b/packages/gatsby-plugin-catch-links/src/catch-links.js index ea96ca0667d28..d60a4cc3fde20 100644 --- a/packages/gatsby-plugin-catch-links/src/catch-links.js +++ b/packages/gatsby-plugin-catch-links/src/catch-links.js @@ -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