mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-22 11:52:09 +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
|
||||
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
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user