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

add Input tel #259

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
22 changes: 20 additions & 2 deletions src/Element/Input.elm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Element.Input exposing
, checkbox, defaultCheckbox
, text, multiline
, Placeholder, placeholder
, username, newPassword, currentPassword, email, search, spellChecked
, username, newPassword, currentPassword, email, search, tel, spellChecked
, slider, Thumb, thumb, defaultThumb
, radio, radioRow, Option, option, optionWith, OptionState(..)
, Label, labelAbove, labelBelow, labelLeft, labelRight, labelHidden
Expand Down Expand Up @@ -75,7 +75,7 @@ If we want to play nicely with a browser's ability to autofill a form, we need t

The following inputs are very similar to `Input.text`, but they give the browser a hint to allow autofill to work correctly.

@docs username, newPassword, currentPassword, email, search, spellChecked
@docs username, newPassword, currentPassword, email, search, tel, spellChecked


# Sliders
Expand Down Expand Up @@ -1561,6 +1561,24 @@ email =
}


{-| -}
tel :
List (Attribute msg)
->
{ onChange : String -> msg
, text : String
, placeholder : Maybe (Placeholder msg)
, label : Label msg
}
-> Element msg
tel =
textHelper
{ type_ = TextInputNode "tel"
, spellchecked = False
, autofill = Just "tel"
}


{-| A multiline text input.

By default it will have a minimum height of one line and resize based on it's contents.
Expand Down