Skip to content

[ngx-forms]: Update errors directive by adding describedBy #320

@IbenTesara

Description

@IbenTesara

The ngxFormsErrors automatically adds an error element below an input when the control has an error. Because of WCAG, we need to link said input to the error-element.

To do so we:

  1. Make the NgxFormsErrorAbstractComponent have an tabIndex of 0
  2. Generate an id using Angular UUID and add that id to the NgxFormsErrorAbstractComponent (Use the signal approach as shown in NgxTourStepComponent)
  3. Add that generated id to the input by using the ariaDescribedBy
  4. Remove the ariaDescribedBy when the error is removed

This issue was created as a result of this talk.

Metadata

Metadata

Labels

enhancementNew feature or requestngx-forms@studiohyperdrive/ngx-forms

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions