Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document for Attributes.value confuses attribute and property #249

Open
arowM opened this issue Feb 23, 2023 · 0 comments
Open

Document for Attributes.value confuses attribute and property #249

arowM opened this issue Feb 23, 2023 · 0 comments

Comments

@arowM
Copy link

arowM commented Feb 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant