amilner42 / code-tidbit

Share Programming Knowledge Better
GNU General Public License v3.0
9 stars 1 forks source link

All navigation on website should use `a` with `href` to allow "open in new tab" #220

Closed amilner42 closed 6 years ago

amilner42 commented 7 years ago

If you just have a div/button, when they right click and "open in new tab", well they won't be able to do that.

We need to switch all our div/buttons, anything that navigates, to use a with href. And then we can add the onClick anyway and do preventDefault to prevent the link from opening in a new URL. This way, the link doesn't trigger from the click, but at the same time it's following html spec and the browser gives you the "open in new tab" buttons and it's better for the visually impaired.

amilner42 commented 7 years ago

https://github.com/elm-lang/html/issues/110