Is it possible to disable Webflow’s click hijacking in specific circumstances? Specifically, when a link is clicked, I’d like to handle the click directly without Webflow’s JS being involved at all. I think I’ve found a bug in how Webflow’s click hijacking handles anchor tag navigation from SVGs, which is a showstopper for this particular site.
Here’s the problem that led me here.
I’ve been helping someone build a Webflow site that involves lots of complex embedded SVGs. Many of those SVGs contain links to named anchors in the same page. E.g.,
<svg><a xlink:href="#g"><path ... /></a></svg>
… when clicked this should take the user to
<div id='g' /> elsewhere in the page.
In Chrome, clicking such links trigger a console error
this.href.split is not a function, but recovers and eventually does the right thing. The URL gets
#g appended to it, and the browser jerks to that location.
In Safari, clicking the link gives the same error, but there is no recovery.
this.href is an
SVGAnimatedString, which doesn’t have the
split function, which causes the error message. I’m guessing that when a ‘normal’ link is clicked,
this.href is a plain old
To reproduce, go to: http://april-johnsons-first-project.webflow.io/sections/structural-cross-sections and (once the big SVG has loaded at the top) click on any of the links, then check the console.