instructure / instructure/instructure-ui

Missing aria-live and aria-errormessage attributes in form field components

Open
#1,914 5 comments 0 reactions 1 assignee View on GitHub

@matyasf is already working on this.

Since Mar 21, 2025.

Dominant language
TypeScript
Stars
480
Forks
108
Avg merge
6d 1h
Merged PRs (30d)
16

Description

Background Information

Package Version(s):

  • ui-form-field v10.14.0
  • ui-select v10.14.0
  • ui-simple-select v10.14.0
  • ui-text-input v10.14.0

Browser: Chrome (observed), potentially all

Screen Reader: Mac VoiceOver (tested), potentially all

Component: FormFieldLayout, Select, SimpleSelect, TextInput

Describe the Issue

Accessibility issues in form field components:

  1. Error messages are not automatically announced by screen readers due to missing aria-live and role="alert" attributes

  2. The aria-errormessage attribute is not being propagated from FormFieldLayout down to input elements

  3. The aria-errormessage attribute does not match the ID of the error message container

Steps To Reproduce
  1. Render a Select or SimpleSelect with error messages
  2. Verify that input elements have aria-invalid but are missing aria-errormessage
  3. Trigger form validation errors
  4. Error messages are not automatically announced (unless focus is on the invalid input)
Expected Behavior
  1. Error message container should:

    • Have aria-live="assertive" and role="alert" for error messages
    • Be persistently in the DOM
  2. Input elements should have both aria-invalid="true" and aria-errormessage pointing to message container ID

  3. Error message container should have an ID matching aria-errormessage

Additional Information

Current Workaround(s): At the moment we are duplicating error messages in a ScreenReaderContent with aria-live="assertive" and role="alert" to ensure they are announced

Products Affected: All form field components

Are you willing to submit a PR to fix?

  • Yes, I'm willing to submit a PR
  • (I may have a speculative fix...)
WCAG Guidelines
  • 1.3.1 Info and Relationships (Level A)
  • 4.1.2 Name, Role, Value (Level A)
  • 3.3.1 Error Identification (Level A)
  • 4.1.3 Status Messages (Level AA)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.