git.iko.soy/typeable/elm-ui
on master help sign in
resolves #236 - checkboxes need proper markup to be read correctly by screen readers
commit18fb463b2b9b6a25c68ffe776ba1ff15b509faa8 authormdgriffith <mdgriffith@users.noreply.github.com> dateSun 26 Jul 2020, 09:01 (6 years ago) parent2dcbb80
1 file changed+13−11
src/Element/Input.elm+13−11
src/Element/Input.elm+13−11
@@ -447,22 +447,24 @@ checkbox attrs { label, icon, checked, onChange } =
447447 ]
448448 ++ attrs
449449 in
450− applyLabel attributes
451− label
452− (Internal.element
453− Internal.asEl
454− Internal.div
455− [ Internal.Attr <|
456− Html.Attributes.attribute "role" "checkbox"
457− , Internal.Attr <|
458− Html.Attributes.attribute "aria-checked" <|
450+ applyLabel
451+ (Internal.Attr (Html.Attributes.attribute "role" "checkbox")
452+ :: Internal.Attr
453+ (Html.Attributes.attribute "aria-checked" <|
459454 if checked then
460455 "true"
461456
462457 else
463458 "false"
464− , hiddenLabelAttribute label
465− , Element.centerY
459+ )
460+ :: hiddenLabelAttribute label
461+ :: attributes
462+ )
463+ label
464+ (Internal.element
465+ Internal.asEl
466+ Internal.div
467+ [ Element.centerY
466468 , Element.height Element.fill
467469 , Element.width Element.shrink
468470 ]