-
Notifications
You must be signed in to change notification settings - Fork 2
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
Radios #59
Comments
Interested in the advice to use error messages like 'Select yes if...'. |
Dropbox Paper auditOn 15 October 2018 the Design System team reviewed a Dropbox Paper document discussing the Radios component. The aim was to reduce the number of places containing guidance and code by:
Below is a record of the outcomes of that review. If you need to, you can see the original Dropbox Paper content in the internet archive. Review outcomesUpdates to the Design SystemThe Design System team will carry out the following updates to ensure that relevant, useful content from the Dropbox Paper file is added to the Design System.
|
Based on the above, we've updated the Design System guidance for: |
The dividers option appears to hardcode the width to 40px - meaning text other than 'or' is likely to break across several lines. I was trying to use dividers to group some related radios with a heading - though I guess this might be unwanted use case depending on how that text appeared to AT users. |
@edwardhorsford I think that is also discussed in alphagov/govuk-frontend#1079 The divider markup doesn't have the correct semantics to do anything other than 'or' right now... |
The term "inline" buttons is obscure for me and I didn't initially know it referred to an arrangement rather than a function or aesthetic. I worked out people were referring to an arrangement but it wasn't clear if it meant vertical or horizontal. I decided it meant vertically arranged because that's clearly a line of adjacent buttons, unlike horizontally arranged buttons mingled with text. Can the guidance say 'horizontal' instead of 'inline' and 'vertical' instead of stack'? |
Hi @terrysimpson99 – thank you for your feedback, it's a good point. I think we'd like to include the word "inline" as that's how it's described in the code, but we could consider also adding horizontal and vertical too, to make it clearer. I will discuss it with the team today and come back to you. |
Are there any examples of Conditional Radio buttons with an error on one of the conditional fields? |
Hi @ChazUK, this is the suggested style in that scenario This is achieved by adding the classes |
@rinto-cyriac I have no direct experience, but have a hunch you can get away with more than you might expect. I'd say it's totally worth trying as one list and seeing how it tests. I've seen anecdotal reports on slack of teams testing with larger numbers than they expected to work, and the tests being positive. A big factor that will affect how many you can show: will users know when they see the option that it's the right one (or will they have to continually scroll back and forth to compare several)? If relevant you may be able to group the options too. |
@edwardhorsford — thanks Ed for the comment, that's an interesting theory to validate it. I was also thinking of having a guidance text underneath some radios/departments that might seem confusing for the user (eg: reporting a dog foul might come under Leisure, parks and attractions as well as Environment) |
@rinto-cyriac have you considered an autocomplete? It sounds like it might be appropriate. You might also take a look at the FCO legalisation service - which did some great work about helping users select from a long list of possible documents - merging search with other selection mechanisms. |
@edwardhorsford — thank you. That was really valuable. Our scope didn't allow to go that extent initially, but it seems now that this component could be used in other areas in the website as well. |
The Nunjucks macro option to conditionally reveal content currently accepts an
This HTML content is then rendered inside the fields containing the radios, and is revealed/hidden when the radio button is selected/deselected. Sometimes, it's desirable to have the revealed content appear after the fieldset containing the radio button, rather than within it — for example, when the revealed content is itself a fieldset. (Nested field sets can be a bit confusing to navigate when using screenreaders.) Is there any interest in allowing macro users to define separate content to be revealed/hidden? Perhaps by taking the ID attribute of the content?
Or a boolean attribute to render the content after the fieldset, rather than within it?
Or something else entirely? See also alphagov/govuk-frontend#718 |
We need your help gathering more research around the conditionally revealing content pattern for this component, this is a shared issue with the Checkboxes component. We'd appreciate it if you could take a look! Thanks :) |
Just thought you should know that the highlighted state for the new Radios control has failed an accessibility audit in our service because the contrast between the yellow highlight and the white page background was deemed as having insufficient contrast. |
Could you share a screenshot of your implementation with the a radio focused? In addition to the yellow colour, the focussed item also has a thicker black border - which definitely has enough contrast. |
@blowfishsoup Hey Neil, this is the pre-v3 release of GOVUK Frontend, this met WCAG 2.0 but has since been updated to meet WCAG 2.1 in v3 and above. You can read about the changes in this release here https://github.com/alphagov/govuk-frontend/blob/master/CHANGELOG.md#300-breaking-release |
I'm getting an accessibility violation (Elements must only use allowed ARIA attributes.) when conditionally revealing a textarea element on selection of a particular radio button. distanceHtml is a textarea. We do use our own components that wrap around the GovUK components so we can add customised error handling. Is there a known issue or is it likely to be a problem with the implementation? |
@roseacre it's a known issue – see alphagov/govuk-frontend#979 for details. |
The guidance on conditional radios and checkboxes states: "If the related question is complicated or has more than one part, show it on the next page in the process instead." Many services conditionally revealed a date. I was made aware of this when a DAC assessment said it was a problem. I commented on this at: #59 (comment) This issue keeps cropping up. When I quote the guidance, it doesn't always help. Some people assert a date is not complicated. Some people assert a date is one part. This means time is wasted in debate about the history or intent of the guidance. I need to be able to quote something more explicit. Please can the guidance be modified to require conditional reveal
|
We received the following usability feedback on this component during our recent accessibility assessment from DAC. Obvious disclaimer that this is effectively one user's feedback.
|
Has anyone had thoughts about the 'Select yes if...' question from 2018? We're rewriting some of our validation error messages, but would be good to know this is backed up by research. |
Hello, hope this is the place to post this: I’ve come across an issue with the radio buttons, and the 'dot' displaying slightly off-centre when using a second screen. When a user is on one of our GOV.UK sites, clicks on the radio button and for what ever reason moves the browser window to their second screen and zooms out (75% or lower), the radio button ‘dot’ will display off-centre. These are the steps to replicate it:
|
Hey @MazOneTwoOne, This is unfortunately not something we have much control over, as it's a factor of how browsers and operating systems handle zooming and pixel rasterisation. Normally, the radio button is 40×40 pixels and the dot is 20×20 pixels offset by 10 pixels from each edge. At 75% zoom, this becomes a 30×30 pixel radio button and a 15×15 pixel dot, which is all good. The 10 pixel offset, however, has now become 7.5 pixels. As a display cannot physically render anything smaller than a pixel, this is a problem. In all likeliness, the offset on the top and left is being rounded down to 7 pixels and the bottom and right offsets are being rounded up to 8 pixels, causing the misalignment. This issue may be manifesting more easily on one screen than the other due to differences in display PPI (pixels per inch). A Mac with a 227 PPI retina display will not suffer the issue as readily as a standard 72 PPI monitor, for example, as the retina display's physical pixels are smaller. We could theoretically resolve this for some zoom levels by tweaking the size of the radios, but there'll always be some zoom levels that are forced to round unevenly. There is no 'one size fits all' solution. |
Thanks @querkmachine, Makes complete sense. Thanks for having a look. |
We ran an external accessibility audit for some of the components and patterns in GOV.UK Frontend in May 2023. In that audit, we included examples of the Radio and Checkboxes components. We’re adding results from that audit here so that we can:
One usability issue raisedNo visible hover for checkboxes and radios in high contrast mode. Can't tell what's being hovered.
More detail in this issue: |
Our team has noticed that when radio buttons have the This is caused by some CSS in GOV.UK Frontend5. I would suggest something like this to differentiate the Colour alone isn’t used here to differentiate – there is still the semantics of the This is what we will be implementing in our interface6 until a suitable fix is in place upstream.
|
@quis Thanks for raising this. I believe we consider this styling to be acceptable as WCAG criterion 1.4.3 includes an exception for text in disabled controls. Although the example given is in relation to button text, I believe this also applies to the radio button label in this instance, as it operates the form control and does not count as 'normal text'. Styling the radio alone runs the risk of it the user clicking the label and being confused that the radio button doesn't respond, though admittedly most users aren't aware that they can click the label. |
@querkmachine thanks, I didn’t know about that criterion. I’d still argue that it’s less confusing if the user can read the text which explains why the button doesn’t respond (‘Not available because…’) than to have a control whose presence they may be able to see but whose text they can’t read. Second – and very specific to the example in the screenshot — but the link text inside the hint definitely needs to meet contrast since users can still interact with it. Finally it feels weird to have some text styled in colours which are outside the normal Design System palette, but that’s not a WCAG thing. |
There are so many problems with disabled elements that I would try to find another solution if at all possible. What about having the message in plain text, not a radio?
Edit: In particular that they get skipped in tab order:
|
When tabbing through screen elements on a form containing radio inputs, only the first radio button is highlighted. When shift+tabbing, only the last radio button is highlighted. To access elements in the middle of the list the user must change from the tab key to the arrow keys. |
@haggishunt56 that is the standard approach to tabbing/keyboard controls for radios, so yes it passes: https://www.accessibility-developer-guide.com/knowledge/keyboard-only/browsing-websites/ |
@oddjones it's very hard to make this accessible, so I think this is a good candidate for this pattern: |
@joelanman nice - yeah that's a really good shout. I think we're going to go with your suggested pattern with a details component to divulge the additional access to the source documents, then keep the radios clear as suggested in the pattern. Thanks for commenting |
Hi can someone give some background on the following accessibility error raised. Conditionally revealed radio buttons are not announced to screen readers On the page (inserted below), there are three radio buttons that users can select from. Two of those radio buttons contain a conditionally revealed input field where users give either their phone number or their email address. In the speech viewer of the screen reader NVDA the radio button is listed as checked however the expanded action is not registered. This was done in Microsoft Edge. However when using Firefox the screen reader registers the conditional radio button as expanded and the word expanded appears in the speech viewer. Visually, it is clear that when users select this the field expands, but this information is not communicated via all screen readers. This will be frustrating for blind and visually impaired users who are not made aware of the dynamic change that appears on screen. It is not clear why this is occurring, as it has been coded to specification, meaning that We understand that the use of |
Should the reveals for radio buttons still be hidden if javascript is disabled/unavailable. I was fairly hiding them (and then revealing them) relied on javascript being enabled on the page in previous versions of govuk frontend. |
Following an accessibility audit we've had a "Major Impact on Functionality" flag as we're using the unsupported Here's a screengrab of Axe run against the radio component. I've seen that this was discussed back in 2018 but thought I'd bump it here for current guidance on GDS' stance. |
Use this issue to discuss this component in the GOV.UK Design System.
The text was updated successfully, but these errors were encountered: