Skip to content

Instantly share code, notes, and snippets.

@AlienKevin
Created May 28, 2020 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlienKevin/9296ce7a420dc663513415d7c36be053 to your computer and use it in GitHub Desktop.
Save AlienKevin/9296ce7a420dc663513415d7c36be053 to your computer and use it in GitHub Desktop.
Detect onClick event without propagation
onClickNoProp : Msg -> Html.Attribute Msg
onClickNoProp msg =
Html.Events.custom "click"
(Decode.succeed
{ message = msg
, stopPropagation = True
, preventDefault = False
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment