-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change error summary ARIA role to "alert" #511
Conversation
@@ -30,9 +30,9 @@ <h2 class="heading-medium implementation-advice">Implementation advice</h2> | |||
</span> | |||
</li> | |||
<li> | |||
indicate to screenreaders that the summary represents a collection of information | |||
make sure that the summary gets announced to as many screen readers as possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor copy suggestion to improve flow and be consistent with the other points:
Ensure that the summary is announced to as many screen readers as possible
userole="alert"
on the containingdiv
Makes sense to me. I'm not an expert on roles by any means, but from a quick Google I don't think we're losing anything important by removing the |
I'm guessing the role role "group" was meant to group related elements (h1, p, ul) together, just looking at form_error_radio_show_errors.html. But W3C say role "group" should be used for form controls so I think the group role here is not doing anything, unless there are form controls inside any of the divs which I couldn't see. |
I wonder if the @36degrees, the copy change makes sense, I will change it when I am back. |
I had a look for the reason why The I'd be keen to know if the JavaScript which is setting focus to the error summary box can also be removed? The documentation for
|
I've finally got a working machine so can do some testing on this. I'll pick this up tomorrow. |
@gemmaleigh, I have tested lots of variations, but I have not tested what happens if we don't set the focus. Good question. I would guess it's still needed due to inconsistent screen reader support but I can make sure and test it. @hannalaakso, I can introduce you to our AT laptops and show you how to test in our various screen readers etc. |
This claims that NVDA + Edge doesn't support role="alert". I guess we need to do some testing. I did test removing the JS that sets focus and using role="alert" and VoiceOver on MacOS 10.11.6 announces it correctly. I was testing in form_error_multiple.html. Thanks @selfthinker have slacked you separately re:intro 👍 |
I don't think NVDA officially supports Edge yet. (Struggling to find evidence of that, though.) So, I think we can ignore that. |
I can currently not fully test this without the focus as our laptops with JAWS etc on them have connection issues. |
I have asked Leonie for feedback on this and she responded:
I haven't made the copy change @36degrees requested yet because I'm waiting for #509 to be merged as I know there will be conflicts. |
An ARIA `role="alert"` on the error summary should not be necessary due to the focus on that area. But without this VoiceOver on iOS doesn't announce the error message at all due to this bug: https://bugs.webkit.org/show_bug.cgi?id=163719 Changing this doesn't change the behaviour in JAWS, NVDA or VO on macOS, but it does mean that ZoomText is not announcing anything. As VO on iOS is used much more often by blind people than ZoomText (ZoomText is used more by visually impaired people who would see the big red alert box), this seems to be a sensible sacrifice.
126b3c2
to
7ef90d6
Compare
I have just made the copy changes. Although #509 isn't merged yet, this one could be merged before it. I guess it doesn't really matter which one is the one that is causing the other to conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does the pull request solve?
Currently neither VoiceOver on iOS or macOS nor TalkBack on Android announce that there is an error when submitting a form with errors. Although we focus on the error summary box, it doesn't have the desired effect. In the iOS case it's because of one browser bug and in the macOS case because of another browser bug. At least the iOS and Android issue can be fixed by adding the ARIA
role="alert"
to the error summary box.I am not sure what the effect will be of removing the
group
role. It didn't seem to have an effect when I tested this but I would like to have someone else's opinion on this.How has this been tested?
Changing this doesn't change the behaviour (postively or negatively) in JAWS, NVDA or VO on macOS, but it does mean that ZoomText is not announcing anything.
As VO on iOS is used much more often by blind people than ZoomText (ZoomText is used more by visually impaired people who would be able to see the big red alert box), this seems to be a sensible sacrifice.
What type of change is it?
Has the documentation been updated?