mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-10-26 17:59:15 +03:00
resolves #236 - checkboxes need proper markup to be read correctly by screen readers
This commit is contained in:
parent
2dcbb80369
commit
18fb463b2b
@ -447,22 +447,24 @@ checkbox attrs { label, icon, checked, onChange } =
|
|||||||
]
|
]
|
||||||
++ attrs
|
++ attrs
|
||||||
in
|
in
|
||||||
applyLabel attributes
|
applyLabel
|
||||||
label
|
(Internal.Attr (Html.Attributes.attribute "role" "checkbox")
|
||||||
(Internal.element
|
:: Internal.Attr
|
||||||
Internal.asEl
|
(Html.Attributes.attribute "aria-checked" <|
|
||||||
Internal.div
|
|
||||||
[ Internal.Attr <|
|
|
||||||
Html.Attributes.attribute "role" "checkbox"
|
|
||||||
, Internal.Attr <|
|
|
||||||
Html.Attributes.attribute "aria-checked" <|
|
|
||||||
if checked then
|
if checked then
|
||||||
"true"
|
"true"
|
||||||
|
|
||||||
else
|
else
|
||||||
"false"
|
"false"
|
||||||
, hiddenLabelAttribute label
|
)
|
||||||
, Element.centerY
|
:: hiddenLabelAttribute label
|
||||||
|
:: attributes
|
||||||
|
)
|
||||||
|
label
|
||||||
|
(Internal.element
|
||||||
|
Internal.asEl
|
||||||
|
Internal.div
|
||||||
|
[ Element.centerY
|
||||||
, Element.height Element.fill
|
, Element.height Element.fill
|
||||||
, Element.width Element.shrink
|
, Element.width Element.shrink
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user