Created
October 10, 2016 17:46
-
-
Save Panya/9741d7fc99b9d69966b511a77f2eca87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Html.App exposing (..) | |
import Dom | |
import Task | |
type Msg | |
= Click | |
| NoOp | |
main = | |
program | |
{ init = "" ! [] | |
, view = view | |
, update = update | |
, subscriptions = \_ -> Sub.none | |
} | |
view model = | |
div [] | |
[ input [ id "focus-me" ] [] | |
, button [ onClick Click ] [ text "Focus" ] | |
] | |
update msg model = | |
case msg of | |
Click -> | |
model ! [Task.perform (always NoOp) (always NoOp) (Dom.focus "focus-me")] | |
_ -> | |
model ! [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment