-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form][WCAG] Add hidden labels on date and time fields #26325
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
Conversation
@@ -40,6 +40,16 @@ | |||
<div {{ block('widget_container_attributes') }}> | |||
{{- form_errors(form.date) -}} | |||
{{- form_errors(form.time) -}} | |||
|
|||
<div style="display:none"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a Bootstrap layout, it would be better to use the bootstrap class to hide these rather than an inline style. CSP may forbid using inline styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and btw, display:none
hides it from screen readers too
Thank you @Nyholm. |
…holm) This PR was squashed before being merged into the 3.4 branch (closes #26325). Discussion ---------- [Form][WCAG] Add hidden labels on date and time fields | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | According to my friend and WCAG2 expect [Sandra](https://twitter.com/sandrability): > "Guidance texts" (my translation) on DateType and DateTimeType etc are missing. It is great that they are grouped with a "fieldset" but it will be more clear if there was a label on each select. Especially since different countries have different time and date formats. The time form is read like "00 00" and you have no idea if it is seconds, minutes or hours. You may do "guidance texts" visually hidden if you do not want to change the looks of the form. But since "month" is shorten to "Jan" instead of "January" you may want to have clear and visual guidance texts. Commits ------- 14978e9 [Form][WCAG] Add hidden labels on date and time fields
According to my friend and WCAG2 expect Sandra: