Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
Created May 14, 2016 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdotdesign/aa92bfa42c219e765eae65fa9ba6dbd4 to your computer and use it in GitHub Desktop.
Save gdotdesign/aa92bfa42c219e765eae65fa9ba6dbd4 to your computer and use it in GitHub Desktop.
Tabindex not getting removed.
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