Set focus on input on page load
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
387b6241a2
commit
dfe012b4c9
@ -10,7 +10,7 @@ module Main exposing
|
|||||||
import Browser
|
import Browser
|
||||||
import Data exposing (Url, hostname, toUrl)
|
import Data exposing (Url, hostname, toUrl)
|
||||||
import Html exposing (Html, fieldset, input, label)
|
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 Html.Events exposing (onInput)
|
||||||
import Parse exposing (parseUrl)
|
import Parse exposing (parseUrl)
|
||||||
|
|
||||||
@ -55,7 +55,15 @@ view : Model -> Html Msg
|
|||||||
view state =
|
view state =
|
||||||
fieldset []
|
fieldset []
|
||||||
[ label [ for "url" ] []
|
[ 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" ] []
|
, label [ for "output" ] []
|
||||||
, input (myStyle [ id "output", readonly True, value (displayMUrl state.parsed) ]) []
|
, input (myStyle [ id "output", readonly True, value (displayMUrl state.parsed) ]) []
|
||||||
|
Loading…
Reference in New Issue
Block a user