avh4 / elm-program-test

Test Elm programs
https://elm-program-test.netlify.com/
MIT License
93 stars 27 forks source link

clickLink onClick validation should not trigger when target="_blank" #90

Open avh4 opened 4 years ago

avh4 commented 4 years ago

Clicking a link with onClick and target="blank" should be allowed, but currently gives:

    clickLink "View tutorial": Found an `<a href="...">` tag has an onClick handler, but the handler is overriding ctrl-click and meta-click.

    A properly behaved single-page app should not override ctrl- and meta-clicks on `<a>` tags because this prevents users from opening links in new tabs/windows.

    Use `onClickPreventDefaultForLinkWithHref` defined at <https://gist.github.com/avh4/712d43d649b7624fab59285a70610707> instead of `onClick` to fix this problem.

    See discussion of this issue at <https://github.com/elm-lang/navigation/issues/13>.
avh4 commented 2 years ago

What is the scenario where this makes sense?