Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Adding a function for virtual-dom's defaultValue property. #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/Html/Attributes.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Html.Attributes
( key, style
, class, classList, id, title, hidden
, type', value, checked, placeholder, selected
, type', value, defaultValue, checked, placeholder, selected
, accept, acceptCharset, action, autocomplete, autofocus, autosave
, disabled, enctype, formaction, list, maxlength, minlength, method, multiple
, name, novalidate, pattern, readonly, required, size, for, form
Expand Down Expand Up @@ -36,7 +36,7 @@ Attributes](#custom-attributes) section to learn how to create new helpers.
@docs class, classList, id, title, hidden

# Inputs
@docs type', value, checked, placeholder, selected
@docs type', value, defaultValue, checked, placeholder, selected

## Input Helpers
@docs accept, acceptCharset, action, autocomplete, autofocus, autosave,
Expand Down Expand Up @@ -519,13 +519,20 @@ type' value =
stringProperty "type" value


{-| Defines a default value which will be displayed in a `button`, `option`,
{-| Defines a value which will be displayed in a `button`, `option`,
`input`, `li`, `meter`, `progress`, or `param`.
-}
value : String -> Attribute
value value =
stringProperty "value" value

{-| Defines a default value which will be displayed the first time a `button`, `option`,
`input`, `li`, `meter`, `progress`, or `param` is rendered.
-}
defaultValue : String -> Attribute
defaultValue value =
stringProperty "defaultValue" value


{-| Indicates whether an `input` of type checkbox is checked. -}
checked : Bool -> Attribute
Expand Down