mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
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:
parent
1ceefc22d5
commit
89f1bb7d2a
@ -22,7 +22,7 @@ export default function interceptClick(e) {
|
||||
}
|
||||
|
||||
const currentTarget = e.currentTarget;
|
||||
const href = currentTarget.href;
|
||||
const href = currentTarget.getAttribute("href");
|
||||
|
||||
if (
|
||||
!href ||
|
||||
|
Loading…
Reference in New Issue
Block a user