aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Events.elm
blob: c50fe9888127a36a6c2926b62f52a88d3d01489e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module View.Events exposing
  ( onSubmitPrevDefault
  )

import Json.Decode as Json
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)

onSubmitPrevDefault : msg -> Attribute msg
onSubmitPrevDefault value =
  onWithOptions
    "submit"
    { defaultOptions | preventDefault = True }
    (Json.succeed value)