Created
May 14, 2016 13:15
-
-
Save gdotdesign/aa92bfa42c219e765eae65fa9ba6dbd4 to your computer and use it in GitHub Desktop.
Tabindex not getting removed.
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
module Main exposing (..) | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.App as App | |
import String | |
type alias Model = | |
{ haveTabindex : Bool } | |
init : Model | |
init = | |
{ haveTabindex = True } | |
type Msg | |
= Change | |
update : Msg -> Model -> Model | |
update msg model = | |
case msg of | |
Change -> | |
{ haveTabindex = False } | |
view : Model -> Html Msg | |
view model = | |
div | |
[] | |
[ div | |
(if model.haveTabindex then | |
[ tabindex 0 ] | |
else | |
[] | |
) | |
[ text "Tab Me" ] | |
, button [ onClick Change ] [ text "setValue" ] | |
] | |
main : Program Never | |
main = | |
App.beginnerProgram | |
{ model = init | |
, update = update | |
, view = view | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment