@@ -330,8 +330,6 @@ The `onPress` handler will be fired either `onClick` or when the element is focu
330330 , label = text "My Button"
331331 }
332332
333−**Note** If you have an icon button but want it to be accessible, consider adding a [`Region.description`](Element-Region#description), which will describe the button to screen readers.
334−
335333-}
336334button :
337335 List (Attribute msg)
@@ -369,17 +367,7 @@ button attrs { onPress, label } =
369367
370368 Just msg ->
371369 Events.onClick msg
372− :: onKeyLookup
373− (\code ->
374− if code == enter then
375− Just msg
376−
377− else if code == space then
378− Just msg
379−
380− else
381− Nothing
382− )
370+ :: onEnter msg
383371 :: attrs
384372 )
385373 )
@@ -457,24 +445,22 @@ checkbox attrs { label, icon, checked, onChange } =
457445 ]
458446 ++ attrs
459447 in
460− applyLabel
461− (Internal.Attr (Html.Attributes.attribute "role" "checkbox")
462− :: Internal.Attr
463− (Html.Attributes.attribute "aria-checked" <|
448+ applyLabel attributes
449+ label
450+ (Internal.element
451+ Internal.asEl
452+ Internal.div
453+ [ Internal.Attr <|
454+ Html.Attributes.attribute "role" "checkbox"
455+ , Internal.Attr <|
456+ Html.Attributes.attribute "aria-checked" <|
464457 if checked then
465458 "true"
466459
467460 else
468461 "false"
469− )
470− :: hiddenLabelAttribute label
471− :: attributes
472− )
473− label
474− (Internal.element
475− Internal.asEl
476− Internal.div
477− [ Element.centerY
462+ , hiddenLabelAttribute label
463+ , Element.centerY
478464 , Element.height Element.fill
479465 , Element.width Element.shrink
480466 ]
@@ -713,7 +699,7 @@ slider attributes input =
713699 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
714700 thumbShadowStyle
715701 )
716− , Internal.Attr (Html.Attributes.class (className ++ " ui-slide-bar focusable-parent"))
702+ , Internal.Attr (Html.Attributes.class (className ++ " focusable-parent"))
717703 , Internal.Attr
718704 (Html.Events.onInput
719705 (\str ->
@@ -779,10 +765,10 @@ slider attributes input =
779765 -- This is after `attributes` because the thumb should be in front of everything.
780766 ++ [ Element.behindContent <|
781767 if vertical then
782− viewVerticalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackWidth
768+ viewVerticalThumb factor thumbAttributes trackWidth
783769
784770 else
785− viewHorizontalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackHeight
771+ viewHorizontalThumb factor thumbAttributes trackHeight
786772 ]
787773 )
788774 Element.none
@@ -1565,8 +1551,6 @@ email =
15651551
15661552By default it will have a minimum height of one line and resize based on it's contents.
15671553
1568−Use `Element.spacing` to change its line-height.
1569−
15701554-}
15711555multiline :
15721556 List (Attribute msg)
@@ -2105,11 +2089,7 @@ onKeyLookup lookup =
21052089 Json.field "key" Json.string
21062090 |> Json.andThen decode
21072091 in
2108− -- We generally want these attached to the keydown event becaues it allows us to prevent default on things like spacebar scrolling the page.
2109− -- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role
2110− Internal.Attr <|
2111− Html.Events.preventDefaultOn "keydown"
2112− (Json.map (\fired -> ( fired, True )) isKey)
2092+ Internal.Attr <| Html.Events.on "keyup" isKey
21132093
21142094
21152095{-| -}
@@ -2205,8 +2185,7 @@ defaultCheckbox : Bool -> Element msg
22052185defaultCheckbox checked =
22062186 Element.el
22072187 [ Internal.htmlClass "focusable"
2208− , Element.width
2209− (Element.px 14)
2188+ , Element.width (Element.px 14)
22102189 , Element.height (Element.px 14)
22112190 , Font.color white
22122191 , Element.centerY
@@ -2242,8 +2221,9 @@ defaultCheckbox checked =
22422221
22432222 else
22442223 1
2245− , Element.inFront
2246− (Element.el
2224+ ]
2225+ (if checked then
2226+ Element.el
22472227 [ Border.color white
22482228 , Element.height (Element.px 6)
22492229 , Element.width (Element.px 9)
@@ -2251,7 +2231,6 @@ defaultCheckbox checked =
22512231 , Element.centerX
22522232 , Element.centerY
22532233 , Element.moveUp 1
2254− , Element.transparent (not checked)
22552234 , Border.widthEach
22562235 { top = 0
22572236 , left = 2
@@ -2260,6 +2239,7 @@ defaultCheckbox checked =
22602239 }
22612240 ]
22622241 Element.none
2263− )
2264− ]
2265− Element.none
2242+
2243+ else
2244+ Element.none
2245+ )