Coder Social home page Coder Social logo

Comments (6)

Fresheyeball avatar Fresheyeball commented on July 26, 2024 3

for anyone here looking to get past this thing. The following delivers the desired behavior

onClickAnchor :: msg -> List (Attribute msg)
onClickAnchor msg = [ preventDefaultOn "click" <| Json.succeed (msg,True), href "#" ]

from browser.

domenkozar avatar domenkozar commented on July 26, 2024 2

For the record, it maps to External ""

from browser.

Pilatch avatar Pilatch commented on July 26, 2024 1

@sporto If you want to test all sorts of behaviors out, I recommend this gist https://gist.github.com/Pilatch/c1b6e5d925c6479a0b2e53892fa2dca3

I have discovered the culprit, and it's not in elm/browser. It's in elm/virtual-dom.

Pull request created for the fix - elm/virtual-dom#142

from browser.

ChristophP avatar ChristophP commented on July 26, 2024

A good example for that is an in-page-anchor.

<a href="#someAnchor">Click here to jump to anchor</a>

<!-- An anchor on the page without href -->
<a name="someAnchor"></a>

from browser.

ChristophP avatar ChristophP commented on July 26, 2024

Just ran into this again. The current behavior is really bad. It basically makes using in page anchor's useless with Browser.application, because you don't want the page to reload there. It would be such an easy fix to just exclude links without an href attribute from the special treatment.

from browser.

pruchay avatar pruchay commented on July 26, 2024

for anyone here looking to get past this thing. The following delivers the desired behavior

onClickAnchor :: msg -> List (Attribute msg)
onClickAnchor msg = [ preventDefaultOn "click" <| Json.succeed (msg,True), href "#" ]

How to use it? Could you please share an example?

from browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.