mdgriffith / style-elements

Create styles that don't mysteriously break!
http://package.elm-lang.org/packages/mdgriffith/style-elements/latest
BSD 3-Clause "New" or "Revised" License
445 stars 49 forks source link

Can't set type_ on inputText #64

Closed dela3499 closed 6 years ago

dela3499 commented 7 years ago

When inputText is defined, the type_ attribute is set to text.

attrs = (Attr.type_ "text" :: Attr.value content :: attrs)

This seems to prevent the user from setting type_ on their own. When I try providing type_ "email" in the attributes list, it doesn't seem to work.

inputText None [ type_ "email" ] ""

Perhaps the first term of the attrs definition can simply be omitted, or left present only when type_ isn't provided as an argument to inputText.

attrs = (Attr.value content :: attrs)

Here's my current workaround.

node "input" <|
    el None
        [ type_ "email"] 
        (text "")
alvivi commented 7 years ago

Same here. You cannot create a password input field (for example) with the current version. 😞

dela3499 commented 7 years ago

@alvivi See the workaround.

In your case:

node "input" <|
    el None
        [ type_ "password"] 
        (text "")
popara commented 7 years ago

http://package.elm-lang.org/packages/mdgriffith/style-elements/4.0.0/Element-Input#username

In 4.0 this is fixed.

Check it out.

mdgriffith commented 6 years ago

This was addressed in v4 :)