Skip to content

Document for Attributes.value confuses attribute and property #249

Description

@arowM

The documentation for Attributes.value says:

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

It says "Defines a default value for input", but is incorrect.
The MDN page about the input tag does indeed say the following, but this is the value attribute, not the value property.

value: The initial value of the control

On the other hand, the Attributes.value implementation seems to set the value property. The MDN page about HTMLInputElement explains that the value property is about the "current value".

cf., https://github.com/elm/html/blob/master/properties-vs-attributes.md

The fundamental problem is that the meaning of "value" in each HTML element is inherently different, but they are all handled by one function at the same time. It is excessive commonization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions