-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reveal named div on radio select #718
Comments
Hi @alextea, |
Until we have something better, a work around you can use is to structure your markup like so <div data-module="radios">
<div class="govuk-radios">
<!-- items here -->
</div>
<!-- other stuff here -->
<div id="conditional-reveal"></div>
</div> |
Hi @alextea, |
We're intending to fix the inline radios with conditional reveal which should address some of the issues here. In the meantime you can use the HTML approach, if you find yourself needing to do this in the future, please raise in the backlog as Jani says above. Thanks for raising. |
This has also been raised by another community member who wanted to be able to do something like this: {{ govukRadios({
classes: "govuk-radios--inline",
idPrefix: "basedInTheUK",
name: "createNewAccount.basedInTheUK",
fieldset: {},
items: [
{
value: "yes",
text: "Yes",
checked: checked("createNewAccount.basedInTheUK",'yes'),
attributes:
{
"data-aria-controls": "hidden-representative-email"
}
},
{
value: "no",
text: "No",
checked: checked("createNewAccount.basedInTheUK",'no')
}
]
}) }} |
We've found a workaround that isn't too clunky:
Would be nice to find a more concise way of doing this bit:
Any ideas? |
Separating content from other content from which it is associated with in the markup needs particular consideration with regards to assistive technologies. If we were going to introduce this as a proper feature, we'd need to be confident that it could be done in such a way that it didn't introduce barriers for users of assistive technologies – especially screen readers and magnification tools. We'd need to see evidence from user research with those users (of mixed abilities, i.e. not just 'power' users), showing that conditionally revealing another element elsewhere on the page (as in, not immediately following the radio button / checkbox) is clearly communicated to the user, that they understand that something has happened and how to navigate to the revealed controls. We'd also need to see examples of cases where this pattern is shown to provide a better experience than e.g. splitting the form over multiple pages or using the existing conditional reveal pattern where the content is revealed immediately after the control. |
In some layouts it would be useful to reveal a div below the set of radio buttons based on the option selected.
The markup could work a bit like this:
The text was updated successfully, but these errors were encountered: