question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mat-error is not making aria-live announcements

See original GitHub issue

MatError 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ramjiseetharamancommented, Nov 27, 2020

@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/)

Note: The displayed message in this example is coded using a <span> element that has an aria-live attribute with the value polite. The contents of this so called “live region” are conveyed to screen readers and other assistive technology. The value “polite” de-emphasizes the importance of the message and does not cause screen readers to interrupt their current tasks to read aloud this message. Thus the message is only read once when the user stops typing rather than on every keystroke that the user makes.

PS: Unfortunately, since the Usability study is a proprietary property of my company, I can’t share any links here.

0reactions
angular-automatic-lock-bot[bot]commented, Aug 8, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found