You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.
All examples seem to use buttons with onClick event handlers, which is convenient but bad for UX. For example, what if a user wants to open a link in a new tab?
I've been looking for a way to employ a tags for navigation purposes and I came up with this:
link : Route -> List (Attribute Msg) -> List (Html Msg) -> Html Msg
link route attrs =
a
(List.append
attrs
[ href (Routing.reverse route)
, onClick (NavigateTo route)
]
)
...and this works, but clicking on a link now does a full page reload 😕 I could use a custom click handler with preventDefault, but at that point I'd rather seek guidance in the library API or docs - is there a better way to handle this?
The text was updated successfully, but these errors were encountered:
All examples seem to use
button
s withonClick
event handlers, which is convenient but bad for UX. For example, what if a user wants to open a link in a new tab?I've been looking for a way to employ
a
tags for navigation purposes and I came up with this:...and this works, but clicking on a link now does a full page reload 😕 I could use a custom click handler with preventDefault, but at that point I'd rather seek guidance in the library API or docs - is there a better way to handle this?
The text was updated successfully, but these errors were encountered: