Programmatically associate error messages with inputs

Created on 23 September 2019, almost 5 years ago
Updated 18 June 2024, 7 days ago

Problem/Motivation

I would like the field errors to have the same structure as the description of the field - unique id and his id added to his corrsponding input `aria-describedby` attribut (look screenshot).

Proposed resolution

Add this attribute as it is added to the Webform description label.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
FormΒ  β†’

Last updated about 9 hours ago

Created by

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.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Pipeline finished with Failed
    5 months ago
    Total: 166s
    #86343
  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    Rebased and address the feedback from alex.

    Unfortunately this doesn't work. It was really broken and the ID attachement didn't seem to work at all. I fixed that but it only works for simple elements. When trying to attach to groups like radios or checkboxes, the ID in displayErrorMessages is the collection, but the ID in setElementErrorsFromFormState is the ID of the specific input and these don't match.

    For example testing on umami search,

    edit-type--error-message

    but the element is

    edit-type-article

    referencing

    edit-type-article--error-message

    Definitely needs a lot of tests.

  • Pipeline finished with Failed
    3 months ago
    Total: 184s
    #122642
  • Pipeline finished with Failed
    3 months ago
    Total: 561s
    #122764
  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    got some tests in place that identify some of the pending issues. not passing because we've got some hard problems to solves still.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 144s
    #161885
  • Pipeline finished with Failed
    about 2 months ago
    Total: 398s
    #161902
  • Pipeline finished with Failed
    7 days ago
    Total: 175s
    #202315
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    I have rebased both merge requests.

  • Pipeline finished with Failed
    7 days ago
    #202318
  • Pipeline finished with Failed
    7 days ago
    Total: 194s
    #202321
  • Pipeline finished with Canceled
    7 days ago
    Total: 31s
    #202330
  • Pipeline finished with Failed
    7 days ago
    Total: 433s
    #202332
  • Pipeline finished with Failed
    7 days ago
    Total: 645s
    #202331
Production build 0.69.0 2024