Skip to content

for should be an attribute rather than a property #148

Description

@decioferreira

Link to SSCCE: https://ellie-app.com/kGcc5FVT7a1/4

As described on the example, when a label element without a for property is replaced by one that has the for property on the DOM tree, when re-adding the first element it will be rendered with a for property with value of "empty string".

After talking with @zwilias, this seems to be related with #142 and a workaround seems to be:

for_ : String -> Html.Attribute msg
for_ =
    Html.Attributes.attribute "htmlFor"

A working example with this workaround can be found on https://ellie-app.com/mckMkM7SZa1/1

Also, the relevant spec: https://html.spec.whatwg.org/multipage/forms.html#the-label-element

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