aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Events.elm
blob: d71d67d229c299d2c26531aa4bccd5e45120bc72 (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 Decode
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)

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