mat-error is not making aria-live announcements
See original GitHub issueMatError
has role="alert"
applied, but this won’t take effect when it’s appended to the DOM. We need to either:
- Change
<mat-error>
to always be in the DOM (display: none
) and show it when a form-field goes into error-state, or - Use the
LiveAnnouncer
service to announce the contents (as an alert) when the control goes into an error state.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Accessibility issue on error and when error are removed
Now I shift my focus back to input field and without making any changes I blur out of the field. So the same...
Read more >Make it Accessible: Dealing with Form Errors in Angular
This attribute tells the Screen Readers that it has to announce to the users when its content changes. For aria-live you can use...
Read more >Using ARIA role=alert or Live Regions to Identify Errors
When using Firefox with JAWS and NVDA role=alert is announced as "Alert" and aria-live=assertive does not include that extra text.
Read more >Form field
This error occurs when you have not added a form field control to your form field. If your form field contains a native...
Read more >ARIA live regions - Accessibility - MDN Web Docs - Mozilla
Generally, a change to an assertive live region will interrupt any announcement a screen reader is currently making.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mfairchild365 - I feel that since we are associating the input field with the error message using the aria-describedby attribute, we don’t need to live region on the inline error message. I have had an opportunity working with users to do Usability testing on forms. One thing we inferred from that is, 70% of the users felt that the announcement of the error messages as live regions were jarring/annoying. The reasoning behind that is that, assistive technology users reported that they navigate through all the input fields first to get the feel of what is expected out of the form before they start filling out. Announcement of the message for every tab was jarring/annoying for them.
With that being said, if you really want to communicate the error messages as live regions, it is recommended by W3C to use
aria-live="polite"
rather than role=“alert” which implicitly corresponds to aria-live=“assertive” and aria-atomic=“true”. Please find the link as reference. (https://www.w3.org/WAI/tutorials/forms/notifications/)PS: Unfortunately, since the Usability study is a proprietary property of my company, I can’t share any links here.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.