resolves #236 - checkboxes need proper markup to be read correctly by screen readers

This commit is contained in:
mdgriffith 2020-07-26 09:01:17 -04:00
parent 2dcbb80369
commit 18fb463b2b

View File

@ -447,22 +447,24 @@ checkbox attrs { label, icon, checked, onChange } =
]
++ attrs
in
applyLabel attributes
label
(Internal.element
Internal.asEl
Internal.div
[ Internal.Attr <|
Html.Attributes.attribute "role" "checkbox"
, Internal.Attr <|
Html.Attributes.attribute "aria-checked" <|
applyLabel
(Internal.Attr (Html.Attributes.attribute "role" "checkbox")
:: Internal.Attr
(Html.Attributes.attribute "aria-checked" <|
if checked then
"true"
else
"false"
, hiddenLabelAttribute label
, Element.centerY
)
:: hiddenLabelAttribute label
:: attributes
)
label
(Internal.element
Internal.asEl
Internal.div
[ Element.centerY
, Element.height Element.fill
, Element.width Element.shrink
]