Skip to content

Commit

Permalink
Only handle links with an href
Browse files Browse the repository at this point in the history
Closes elm#34
  • Loading branch information
lydell committed Jul 4, 2024
1 parent 5ab3af6 commit 0adeac6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Elm/Kernel/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function _Browser_application(impl)

return F2(function(domNode, event)
{
if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download'))
if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download') && domNode.hasAttribute('href'))
{
event.preventDefault();
var href = domNode.href;
Expand Down

0 comments on commit 0adeac6

Please sign in to comment.