-
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
Fieldset #48
Comments
you're right that there doesnt appear to be a nunjucks option, but its odd because Radios and Checkboxes use fieldsets and do support error messages, so I'd start looking there for the right approach https://design-system.service.gov.uk/components/radios/#error-messages |
Good shout @joelanman. Looking at the HTML I can see the class
By wrapping the fieldset in a conditional div with the Sidenote on the line break |
Should this example on the question page pattern not be using the fieldset, to utilise the page heading ('Passport details') for its legend? |
@jrbarnes9 Not particularly. The use case for a fieldset is to group multiple inputs together that relate to the same 'question'. For example, asking for a user's address may have multiple address line fields, a list of checkboxes asking for preferred contact methods, or the 'expiry date' example in that screenshot. One question, multiple inputs. You could argue that there is one overarching question here ('What are your passport details?') but for our purposes it's two questions—you could split this across two separate pages and it would still make sense in a way that splitting up lines of an address wouldn't. Nesting fieldsets is also generally not good for accessibility, as screen readers may not announce the correct legend, or will be overly verbose and re-announce every legend. |
I think we need to label every input field. Both (required) and (optional). According to my reading of this: https://www.w3.org/WAI/WCAG21/Techniques/general/G131.html And this: https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions We currently only label (optional) fields, is this right? |
@Nikolaos-Gkionis WCAG is presented in quite a confusing way, I find. WCAG's actual requirements are here: The relevant points for labels are these two
So the requirements are: you must have labels (associated with the fields), and they must be descriptive. The other docs you linked are guidance to help meet WCAG, and not part of the standard themselves. One of them said 'or the optional fields', so our approach of only marking optional fields is covered. However this line has been removed in the latest version, I've raised an issue here: Fundamentally, the most important thing is whether the approach works for all users. We've used this approach for many years and I'm not aware of it causing issues. In fact I think its more clear to label optional fields than imply they are optional by the lack of an asterisk or 'required'. One suggestion if it ever was an issue might be to have a notice at the start along the lines of 'You must answer all questions unless they are marked as optional' |
Use this issue to discuss this component in the GOV.UK Design System.
The text was updated successfully, but these errors were encountered: