-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<a> elements without href
cause page reloads with Browser.application
in Elm 0.19
#17
Comments
adds a `href = ""` attribute to all elements using <a> relies on reordering of elements in `node` function to work (user specified `href` attribute will take precedence because specified last) closes surprisetalk#17
A workaround is to provide a |
@JolandaNava Does Also, there's a PR with a proper fix in elm/virtual-dom#142, but not easy to say when that'll get merged and released. A (temporary) fix here seems like a good idea still. |
@glennsl it doesn't reload the page in my current project (hence the suggestion). I am following the SPA example for how I handle routing so maybe I'm implicitly doing what you suggested in my update? |
Interesting, I guess I somehow got it wrong before then, and that it generates a |
Sorry I've been out of the loop! And thanks for the amazing work @JolandaNava ! |
This is because "empty" links will cause a
UrlRequest
withBrowser.External ""
.My solution is to pattern match on this and just do nothing. You'll most likely pattern match on the
UrlRequest
anyway to get at the contents of it, so it's a small change, but not terribly obvious. So it might be a good idea to warn of this in the documentation.Unless there are better solutions that can be implemented in the library to avoid the user dealing with this entirely, but I do not think there is.
The text was updated successfully, but these errors were encountered: