FIX: with vanilla js .href and getAttribute("href") are not equal (#12609)

With a link having an empty href: `<a href>foo</a>` doing
`element.href` will give you the URL of the document, to get the same behavior than `$(element).attr("href")` and get "" you need to do `element.getAttribute("href")`
This commit is contained in:
Joffrey JAFFEUX 2021-04-06 00:36:28 +02:00 committed by GitHub
parent 1ceefc22d5
commit 89f1bb7d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ export default function interceptClick(e) {
}
const currentTarget = e.currentTarget;
const href = currentTarget.href;
const href = currentTarget.getAttribute("href");
if (
!href ||