@@ -330,8 +330,6 @@ The `onPress` handler will be fired either `onClick` or when the element is focu
330 , label = text "My Button"
330 , label = text "My Button"
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.
337 List (Attribute msg)
335 List (Attribute msg)
@@ -369,17 +367,7 @@ button attrs { onPress, label } =
370 Just msg ->
368 Just msg ->
371 Events.onClick msg
369 Events.onClick msg
372− :: onKeyLookup
370+ :: onEnter msg
374− if code == enter then
377− else if code == space then
@@ -457,24 +445,22 @@ checkbox attrs { label, icon, checked, onChange } =
460− applyLabel
448+ applyLabel attributes
461− (Internal.Attr (Html.Attributes.attribute "role" "checkbox")
454+ Html.Attributes.attribute "role" "checkbox"
462− :: Internal.Attr
455+ , Internal.Attr <|
463− (Html.Attributes.attribute "aria-checked" <|
456+ Html.Attributes.attribute "aria-checked" <|
464 if checked then
457 if checked then
470− :: hiddenLabelAttribute label
462+ , hiddenLabelAttribute label
477− [ Element.centerY
463+ , Element.centerY
478 , Element.height Element.fill
464 , Element.height Element.fill
479 , Element.width Element.shrink
465 , Element.width Element.shrink
@@ -713,7 +699,7 @@ slider attributes input =
713 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
699 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
714 thumbShadowStyle
700 thumbShadowStyle
716− , Internal.Attr (Html.Attributes.class (className ++ " ui-slide-bar focusable-parent"))
702+ , Internal.Attr (Html.Attributes.class (className ++ " focusable-parent"))
717 , Internal.Attr
703 , Internal.Attr
718 (Html.Events.onInput
704 (Html.Events.onInput
@@ -779,10 +765,10 @@ slider attributes input =
779 -- This is after `attributes` because the thumb should be in front of everything.
765 -- This is after `attributes` because the thumb should be in front of everything.
780 ++ [ Element.behindContent <|
766 ++ [ Element.behindContent <|
781 if vertical then
767 if vertical then
782− viewVerticalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackWidth
768+ viewVerticalThumb factor thumbAttributes trackWidth
785− viewHorizontalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackHeight
771+ viewHorizontalThumb factor thumbAttributes trackHeight
788 Element.none
774 Element.none
@@ -1565,8 +1551,6 @@ email =
1566By default it will have a minimum height of one line and resize based on it's contents.
1552By default it will have a minimum height of one line and resize based on it's contents.
1568−Use `Element.spacing` to change its line-height.
1571multiline :
1555multiline :
1572 List (Attribute msg)
1556 List (Attribute msg)
@@ -2105,11 +2089,7 @@ onKeyLookup lookup =
2105 Json.field "key" Json.string
2089 Json.field "key" Json.string
2106 |> Json.andThen decode
2090 |> Json.andThen decode
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 <|
2092+ Internal.Attr <| Html.Events.on "keyup" isKey
2111− Html.Events.preventDefaultOn "keydown"
2112− (Json.map (\fired -> ( fired, True )) isKey)
@@ -2205,8 +2185,7 @@ defaultCheckbox : Bool -> Element msg
2205defaultCheckbox checked =
2185defaultCheckbox checked =
2206 Element.el
2186 Element.el
2207 [ Internal.htmlClass "focusable"
2187 [ Internal.htmlClass "focusable"
2208− , Element.width
2188+ , Element.width (Element.px 14)
2210 , Element.height (Element.px 14)
2189 , Element.height (Element.px 14)
2211 , Font.color white
2190 , Font.color white
2212 , Element.centerY
2191 , Element.centerY
@@ -2242,8 +2221,9 @@ defaultCheckbox checked =
2245− , Element.inFront
2224+ ]
2246− (Element.el
2226+ Element.el
2247 [ Border.color white
2227 [ Border.color white
2248 , Element.height (Element.px 6)
2228 , Element.height (Element.px 6)
2249 , Element.width (Element.px 9)
2229 , Element.width (Element.px 9)
@@ -2251,7 +2231,6 @@ defaultCheckbox checked =
2251 , Element.centerX
2231 , Element.centerX
2252 , Element.centerY
2232 , Element.centerY
2253 , Element.moveUp 1
2233 , Element.moveUp 1
2254− , Element.transparent (not checked)
2255 , Border.widthEach
2234 , Border.widthEach
2256 { top = 0
2235 { top = 0
2257 , left = 2
2236 , left = 2
@@ -2260,6 +2239,7 @@ defaultCheckbox checked =
2262 Element.none
2241 Element.none
2265− Element.none
2244+ Element.none