Open alisonjo315 opened 1 year ago
Yes, this should be done - I believe we have even done this already on some of our sites, potentially not all though as not all sites have form fields with additional descriptive text. (Although I may just be thinking of Laravel stuff, not Drupal)
While I'm not the most knowledgeable on the team about form creation on Drupal, is this going to add an optional field to add descriptive text when creating forms?
Thanks for the feedback @sg667!
The field description/help text is already an optional thing you can fill in when you configure exposed filtering forms on Views. In other words, when you set up a listing page, if that listing page has filtering options for end users (i.e. "filter this list of news by category / text"), when you configure those filters, you can set a label and a description. (Technically, the label is also optional?! I never noticed that before lol, wow.)
Below is a screenshot/excerpt of the configuration form for a views filtering field.
Does that make sense and answer your question, or not really?
Wrinkle: There are no views on our Drupal demo site that have exposed forms, so we can't actually show/test it on our demo site! -- maybe let's add an exposed filter to a view on our demo site?? https://github.com/CU-CommunityApps/cd_drupal_upstream/issues/80
_For this task, use the exposed filter form on the News listing page (via PR #89)._
aria-describedby
to form fields:aria-describedby
.role="Search" aria-label="Filter results"
to the<form>
element.Thing 1
Example markup, based on text search/filter on Einaudi > News (edited for length):
Thing 2
On Kavli, we had to add a template/theme suggestion in .theme, then a custom template. Full details can be seen in this commit:
bd294671c7d
Example markup, based on text search/filter on Kavli > News and Events:
To do
⚠️ Alison: Refresh this to-do list!
core/modules/system/templates/input.html.twig
)Suggested by Hank on Slack, with this reference: https://www.tpgi.com/using-aria-describedby-to-provide-helpful-form-hints/