mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-19 03:31:32 +03:00
Don't use aria-controls
it seems like aria-controls is causing a bug where VoiceOver thinks there are 3 radio inputs
This commit is contained in:
parent
2705aa3186
commit
a96bcb581b
@ -301,20 +301,17 @@ view { label, name, value, valueToString, selectedValue } attributes =
|
||||
|> Maybe.withDefault True
|
||||
|> not
|
||||
|
||||
( disclosureIds, disclosureElements ) =
|
||||
case ( config.disclosedContent, isChecked ) of
|
||||
( [], _ ) ->
|
||||
( [], [] )
|
||||
|
||||
( _, False ) ->
|
||||
( [], [] )
|
||||
|
||||
( _, True ) ->
|
||||
( List.indexedMap
|
||||
(\index _ -> (idValue ++ "-disclosure-content-") ++ String.fromInt index)
|
||||
config.disclosedContent
|
||||
, config.disclosedContent
|
||||
( disclosureIds, disclosedElements ) =
|
||||
config.disclosedContent
|
||||
|> List.indexedMap
|
||||
(\index element ->
|
||||
let
|
||||
id_ =
|
||||
(idValue ++ "-disclosure-content-") ++ String.fromInt index
|
||||
in
|
||||
( id_, span [ Attributes.id id_ ] [ element ] )
|
||||
)
|
||||
|> List.unzip
|
||||
|
||||
isInError =
|
||||
InputErrorAndGuidanceInternal.getIsInError config.error
|
||||
@ -354,7 +351,7 @@ view { label, name, value, valueToString, selectedValue } attributes =
|
||||
_ ->
|
||||
Extra.none
|
||||
, class "Nri-RadioButton-HiddenRadioInput"
|
||||
, Attributes.attribute "aria-controls" (String.join " " disclosureIds)
|
||||
, Aria.describedBy disclosureIds
|
||||
, css
|
||||
[ position absolute
|
||||
, top (pct 50)
|
||||
@ -452,7 +449,12 @@ view { label, name, value, valueToString, selectedValue } attributes =
|
||||
]
|
||||
, InputErrorAndGuidanceInternal.view idValue config
|
||||
]
|
||||
++ disclosureElements
|
||||
++ (if isChecked then
|
||||
disclosedElements
|
||||
|
||||
else
|
||||
[]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user