feat(mat-error): Make mat-error politeness configurable and/or have a less disruptive default. #21781
Labels
Accessibility
This issue is related to accessibility (a11y)
feature
This issue represents a new feature or feature request rather than a bug or bug fix
G
This is is related to a Google internal issue
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Feature Description
I would like for the
<mat-error>
component to not userole="alert"
and instead usearia-live="polite"
or at least make the politeness configurable via an Input binding as in many cases the assertive/interruptive announcement is harmful to the user.Use Case
Assuming mat-errors can appear as a dynamic update (which they can, because form fields can validate on blur or while typing), that update needs to be expressed to the user in some form to comply with WCAG 4.1.2. AFAIK there is nothing that says that the user must be interrupted to do so. In most screen readers the usage of the
role="alert"
, on inline dynamic errors that occur when focus leaves a field, can cause the error message to supersede announcing the new control that has focus. This can lead to additional errors where the user changes the value of the wrong fieldImplementation Details
Happy to contribute myself.
The text was updated successfully, but these errors were encountered: