Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IbenTesara opened this issue Dec 7, 2024 · 0 comments
Open

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

IbenTesara opened this issue Dec 7, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request ngx-forms @studiohyperdrive/ngx-forms

Comments

@IbenTesara
Copy link
Contributor

IbenTesara commented Dec 7, 2024

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.

@IbenTesara IbenTesara added enhancement New feature or request ngx-forms @studiohyperdrive/ngx-forms labels Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ngx-forms @studiohyperdrive/ngx-forms
Projects
None yet
Development

No branches or pull requests

2 participants