Remove the aria-describedby introduced in FAPI if there is no description

Created on 6 August 2015, over 9 years ago
Updated 12 March 2024, 10 months ago

Coming from #2467863: Login form's aria-describeby points to an element that doesn't exist β†’ @crasx correctly points out that it would be better to fix this centrally:

Could we add something to the render layer to remove the aria-describedby if there is no description attribute or does this need to be done on a form by form basis?

This would be a better solution to ensure that Drupal forms are semantically correct and not introducing accessibility errors.

It would be best to remove the aria-describedby introduced in FAPI if there is no description available for the form element.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
FormΒ  β†’

Last updated 2 days ago

Created by

πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    I have seen this in Views exposed filters. The aria-describedby attribute is added in core/lib/Drupal/Core/Form/FormBuilder.php. The description elements would be created in core/includes/form.inc. Adding some ksm() calls, I see that #description has content in FormBuilder.php but is the empty string in form.inc.

Production build 0.71.5 2024