@@ -369,7 +369,17 @@ button attrs { onPress, label } =
370 Just msg ->
370 Just msg ->
371 Events.onClick msg
371 Events.onClick msg
372− :: onEnter msg
372+ :: onKeyLookup
374+ if code == enter then
377+ else if code == space then
@@ -447,22 +457,24 @@ checkbox attrs { label, icon, checked, onChange } =
450− applyLabel attributes
460+ applyLabel
456− Html.Attributes.attribute "role" "checkbox"
461+ (Internal.Attr (Html.Attributes.attribute "role" "checkbox")
457− , Internal.Attr <|
462+ :: Internal.Attr
458− Html.Attributes.attribute "aria-checked" <|
463+ (Html.Attributes.attribute "aria-checked" <|
459 if checked then
464 if checked then
464− , hiddenLabelAttribute label
470+ :: hiddenLabelAttribute label
465− , Element.centerY
477+ [ Element.centerY
466 , Element.height Element.fill
478 , Element.height Element.fill
467 , Element.width Element.shrink
479 , Element.width Element.shrink
@@ -701,7 +713,7 @@ slider attributes input =
701 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
713 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
702 thumbShadowStyle
714 thumbShadowStyle
704− , Internal.Attr (Html.Attributes.class (className ++ " focusable-parent"))
716+ , Internal.Attr (Html.Attributes.class (className ++ " ui-slide-bar focusable-parent"))
705 , Internal.Attr
717 , Internal.Attr
706 (Html.Events.onInput
718 (Html.Events.onInput
@@ -767,10 +779,10 @@ slider attributes input =
767 -- This is after `attributes` because the thumb should be in front of everything.
779 -- This is after `attributes` because the thumb should be in front of everything.
768 ++ [ Element.behindContent <|
780 ++ [ Element.behindContent <|
769 if vertical then
781 if vertical then
770− viewVerticalThumb factor thumbAttributes trackWidth
782+ viewVerticalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackWidth
773− viewHorizontalThumb factor thumbAttributes trackHeight
785+ viewHorizontalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackHeight
776 Element.none
788 Element.none
@@ -1553,6 +1565,8 @@ email =
1554By default it will have a minimum height of one line and resize based on it's contents.
1566By 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.
1557multiline :
1571multiline :
1558 List (Attribute msg)
1572 List (Attribute msg)
@@ -2091,7 +2105,11 @@ onKeyLookup lookup =
2091 Json.field "key" Json.string
2105 Json.field "key" Json.string
2092 |> Json.andThen decode
2106 |> 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
2094− Internal.Attr <| Html.Events.on "keyup" isKey
2110+ Internal.Attr <|
2111+ Html.Events.preventDefaultOn "keydown"
2112+ (Json.map (\fired -> ( fired, True )) isKey)
@@ -2187,7 +2205,8 @@ defaultCheckbox : Bool -> Element msg
2187defaultCheckbox checked =
2205defaultCheckbox checked =
2188 Element.el
2206 Element.el
2189 [ Internal.htmlClass "focusable"
2207 [ Internal.htmlClass "focusable"
2190− , Element.width (Element.px 14)
2208+ , Element.width
2191 , Element.height (Element.px 14)
2210 , Element.height (Element.px 14)
2192 , Font.color white
2211 , Font.color white
2193 , Element.centerY
2212 , Element.centerY
@@ -2223,9 +2242,8 @@ defaultCheckbox checked =
2226− ]
2245+ , Element.inFront
2228− Element.el
2246+ (Element.el
2229 [ Border.color white
2247 [ Border.color white
2230 , Element.height (Element.px 6)
2248 , Element.height (Element.px 6)
2231 , Element.width (Element.px 9)
2249 , Element.width (Element.px 9)
@@ -2233,6 +2251,7 @@ defaultCheckbox checked =
2233 , Element.centerX
2251 , Element.centerX
2234 , Element.centerY
2252 , Element.centerY
2235 , Element.moveUp 1
2253 , Element.moveUp 1
2254+ , Element.transparent (not checked)
2236 , Border.widthEach
2255 , Border.widthEach
2237 { top = 0
2256 { top = 0
2238 , left = 2
2257 , left = 2
@@ -2241,7 +2260,6 @@ defaultCheckbox checked =
2243 Element.none
2262 Element.none
2246− Element.none
2265+ Element.none