-
Notifications
You must be signed in to change notification settings - Fork 27.4k
feat(ngAria): Announce ngMessages with aria-live #9834
Conversation
@marcysutton what do you think? |
@matsko I'm not sure why this got added to the backlog...it's such an easy win, and it has test coverage. Does it need benchmarks or something? |
+1 |
@marcysutton not sure who triaged this one, but if you're good to take it over then go for it :) |
@matsko I don't think I have Collaborator rights on this repo, only Angular Material. Is there someone else who can review and merge it? |
I'll take a look |
The proof of concept works for me (it's extremely annoying when typing in the field though!), that's pretty cool. I'll land it. |
Hmm, it read at an okay frequency when I made the demo. We could always change it to |
the tone actually sounds okay, it's just the way it continuously repeats numbers you type in the field. I'm sure it would be less annoying if I couldn't see what I typed, though. |
I guess it depends a bit on how validation messages are used. We only show them after the first blur event or after the first attempt to submit, assertive is probably fine in this case. If the message is shown after the first user entry it might be very annoying. |
TIL, thanks! (however, I'm talking about the reading of the value in the input field, not the reading of the messages --- those sounded great on my mac with VoiceOver. The reading of the value got a bit crazy) |
I'm wondering if there could be a way to allow for the author to choose
|
We can totally do that! It probably should have been configurable from the start, but that's an easy change. |
To be accessible, error messages shown with
ngMessages
should be read aloud in a screen reader. This can be easily accomplished by addingaria-live="assertive"
to thengMessages
directive viangAria
.Proof of concept in this Plunkr: http://plnkr.co/edit/6iFNWiSiRWz9y871v7oq