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:
- Make the NgxFormsErrorAbstractComponent have an tabIndex of 0
- Generate an id using Angular UUID and add that id to the NgxFormsErrorAbstractComponent (Use the signal approach as shown in NgxTourStepComponent)
- Add that generated id to the input by using the
ariaDescribedBy
- Remove the
ariaDescribedBy when the error is removed
This issue was created as a result of this talk.
The
ngxFormsErrorsautomatically 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:
ariaDescribedByariaDescribedBywhen the error is removedThis issue was created as a result of this talk.