fix(client): do nothing on anchor elements with empty href

closes #3950
pull/3291/head
Divyansh Singh 4 weeks ago
parent 5d3ed87f85
commit 6461f5d42b

@ -187,10 +187,10 @@ export function createRouter(
(link instanceof SVGElement || !link.download) (link instanceof SVGElement || !link.download)
) { ) {
const { target } = link const { target } = link
const linkHref = link.getAttribute('href')
if (linkHref == null) return
const { href, origin, pathname, hash, search } = new URL( const { href, origin, pathname, hash, search } = new URL(
link.href instanceof SVGAnimatedString linkHref,
? link.href.animVal
: link.href,
link.baseURI link.baseURI
) )
const currentUrl = new URL(location.href) // copy to keep old data const currentUrl = new URL(location.href) // copy to keep old data

Loading…
Cancel
Save