Set focus on input on page load
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Valentin Brandl
2019-08-11 16:40:45 +02:00
parent 387b6241a2
commit dfe012b4c9

View File

@ -10,7 +10,7 @@ module Main exposing
import Browser
import Data exposing (Url, hostname, toUrl)
import Html exposing (Html, fieldset, input, label)
import Html.Attributes exposing (for, id, placeholder, readonly, style, value)
import Html.Attributes exposing (autofocus, for, id, placeholder, readonly, style, value)
import Html.Events exposing (onInput)
import Parse exposing (parseUrl)
@ -55,7 +55,15 @@ view : Model -> Html Msg
view state =
fieldset []
[ label [ for "url" ] []
, input (myStyle [ id "url", placeholder "GitHub/GitLab/Bitbucket URL", value state.url, onInput UrlChange ])
, input
(myStyle
[ id "url"
, placeholder "GitHub/GitLab/Bitbucket URL"
, value state.url
, onInput UrlChange
, autofocus True
]
)
[]
, label [ for "output" ] []
, input (myStyle [ id "output", readonly True, value (displayMUrl state.parsed) ]) []