Over the years with applications going more 'SPA' like I have noticed many sites using JavaScript click handlers for websites links which are visually a normal hyperlink (the login link on figma.com for example).
All of the links in the navigation here are <a href="">
except the Log in
and Sign Up
options, both which open a popup.
Personally, if I'm both trying to login but perhaps also read the Blog
link I might right click one or both and use browser functionality to "Open in new tab" leaving me with two tabs open.
By putting no <a>
element on links (I can more forgive the button) it prevents me from using browser functions I might expect which I find frustrating.
Has this been discussed before? is it an anti-pattern? Is there a technical way to give the normal <a>
behaviour as well as the JavaScript popup behaviour if I'm not right clicking?
<a>
for a link? That's the original problem. Ist it a link? Yes: use<a>
. The popup could be inserted somehow else, but you still should use a<a>
. It is a very bad idea to not use a anchor. It breaks user behaviour for no reason but purely design and is exactly why the general DAU exist, because "cool designs" ruin functional patterns.Log in
link is an<a>
element but it has nohref
attribute and the click behaviour is added with JavaScript