WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.3k stars 4.11k forks source link

Snackbar Accessibility Issues #16549

Open mapk opened 5 years ago

mapk commented 5 years ago

I'm breaking out the a11y issues from https://github.com/WordPress/gutenberg/issues/16391 into this issue to make them more actionable and separate them from the other conversation. Thanks, @ryokuhi for getting this started!

Below is pulled from https://github.com/WordPress/gutenberg/issues/16391

Accessibility issues

mapk commented 5 years ago

The Snackbar appears at the bottom left of the screen: this placement is out of view for users with limited vision field, users who use screen magnification, and users who zoom at high levels.

I just tested while zoomed in 300% and was still able to see the snackbar. It appears that at high zoom levels, the snackbar is still viewable, or am I doing something wrong?

snackbar-zoom

I'm not sure how screen magnification works differently from zoomed in, but I'm happy to try testing this as well.

afercia commented 5 years ago

I'm not sure how screen magnification works differently from zoomed in, but I'm happy to try testing this as well.

Yep, it's different :) On a mac, you can try it via System Preferences > Accessibility > Zoom There's also a keyboard shortcut to toggle it, once activated: Option + Cmd + 8 Set it to: Zoom style > Full screen

This way the whole screen is actually limited to a small portion of the page.

afercia commented 5 years ago

Here: https://accessibility.blog.gov.uk/2018/05/15/what-we-learned-from-getting-our-autocomplete-tested-for-accessibility/ some accessibility testers using their setup, including screen magnification with Zoomtext (notice the entire screen becomes the "zoom window").

mapk commented 5 years ago

Yep, it's different :) On a mac, you can try it via System Preferences > Accessibility > Zoom

I gave it a go and it appears that this zooms to where your cursor is. Being that my cursor was over the "Publish" button that's where the screen was zoomed which did cause me to miss the snackbar notification completely.

When zoomed in while publishing, this is okay because I'm focused on the UI messaging which is a good indicator as seen in the image below. However, this doesn't apply to "Updates" or other messages that don't change the UI.

Screen Shot 2019-07-16 at 5 06 19 PM

The older notification across the top did show some sort of UI change, which while wasn't clear what it was for when zoomed in, still indicated something happened.

Screen Shot 2019-07-16 at 5 11 24 PM
afercia commented 5 years ago

Recommended reading from @scottaohara (Who is this guy?) about snackbars / toasts accessibility:

A toast to an accessible toast... https://www.scottohara.me/blog/2019/07/08/a-toast-to-a11y-toasts.html

Scott's post lists some of the considerations made also here, plus other interesting ones.

For completeness: there's a proposal from @jackbsteinberg (Google) to introduce a new HTML element for a "toast" pop-up notification, intended to be included in the Web Incubator Community Group (WICG) once it gets interest.

There's also a first GitHub issue about the new proposed HTML element accessibility by @aardrian 👋 https://github.com/jackbsteinberg/std-toast/issues/25

afercia commented 5 years ago

Special thanks to @NatalieMac for pointing the accessibility team at Scott's post.

grahamarmfield commented 5 years ago

Scott O'Hara also has a working 'toast' example that uses the HTML5 output element with minor attribute additions. This might obviate the need for a brand new element.

See https://scottaohara.github.io/tests/html-output/toastput-aria.html

afercia commented 5 years ago

From the same author, here's a good recap of the main accessibility concerns related to a "toast" (snackbar) component:

A toast to an accessible toast... Scott O’Hara – Jul 8, 2019 https://www.scottohara.me/blog/2019/07/08/a-toast-to-a11y-toasts.html

From the GitHub repo used to propose the standardisation and inclusion in HTML of a "toast" element (note: it's from Google)

Avoid Interactive Children https://github.com/jackbsteinberg/std-toast/issues/29

Adrian Roselli:

Anywhere in the DOM you place a toast that holds interactive controls will likely create both a reading order (1.3.2 Meaningful Sequence) and focus order (2.4.3 Focus Order) WCAG failure on a page/screen. At least not without a lot of native focus management supplemented by author focus management. We already know how difficult that is given the problems with native

implementations in browsers.

Scott O’Hara's feedback on accessibility of some existing "toast" implementations https://github.com/jackbsteinberg/std-toast/issues/29#issuecomment-501779286

Material's demonstration being good to show that the toast comes directly after the invoking element in the document order, so a keyboard user could get to the interactive control before a timeout. However, Material's toast could timeout while a keyboard focus was within the toast, which seems an oversight that should be avoided.

sarahmonster commented 4 years ago

Looks as though Dequeue has been working on a toast as well: https://pattern-library.dequelabs.com/components/toasts

Their three levels more closely correspond to how we are using Modal/Notice/Snackbar right now, but there may be implementation details there worth borrowing.

paaljoachim commented 4 years ago

We discussed it during a Design triage. https://wordpress.slack.com/archives/C02S78ZAL/p1585673618147600

We could move the snackbar notifications to the top center area (similar to other notifications). As it makes it easier for the user to notice the temporary alerts.

aardrian commented 4 years ago

Watching from afar (since I was mentioned) and am stumbling back here to share some more I have written on toasts in general and specific WCAG SC risks along with appropriate roles: https://adrianroselli.com/2020/01/defining-toast-messages.html

I cannot see the design triage nor do I know where to confirm you have discussed these already, so I will just drop them here:

WCAG 2.1 Success Criteria:

UX cases that map to WCAG SCs:

If you have already been through all these and satisfied them, then my apologies for adding noise.

Also, Adam Silver wrote a post a couple weeks ago that might help inform some decisions here: The problem with snackbars and what to use instead