[Snackbar] Accessibility - ESC key while focus is on the toast should close the toast
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
When you keyboard tab-navigate to a snackbar toaster and hit ESC
, the toast stays open.
Expected Behavior 🤔
When you keyboard tab-navigate to a snackbar toaster and hit ESC
, the toast should close, and focus should return back to the element that opened the toast.
While there are no specific aria guidelines for toasters, a modal dialog is probably the closest example:
https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/alertdialog.html
We’ve also been given this feedback from our users.
Steps to Reproduce 🕹
Steps:
- Open up https://material-ui.com/components/snackbars/#simple-snackbars
- Using keyboard only, navigate to “Open Simple Snackbar” button and activate it with space or enter keys.
- Hit tab key once to tab navigate to the toast that appears.
- Hit the ESC key.
- Toast remains open
Context 🔦
Our keyboard-only users expect to be able to close modals/toasters/pop-overs using the ESC key.
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | Latest as per docs |
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[Snackbar] Accessibility - ESC key while focus is on the toast ...
When you keyboard tab-navigate to a snackbar toaster and hit ESC , the toast should close, and focus should return back to the...
Read more >Snackbars - Material Design
Dismiss Key. Pressing the ESC key while one of the snackbar's child elements has focus (e.g., the action button) will dismiss the snackbar....
Read more >Defining 'Toast' Messages - Adrian Roselli
The reading order is a function of when new content is added, and that new content should only be added at the end....
Read more >Toast snackbar banner - Native app accessibility checklist
An element to close it must be available. A message that appears after the user has arrived on the screen must be announced...
Read more >Inline notifications - Carbon Design System
The two main variants of notifications are toast notifications and inline ... press Enter or Space while the close x has focus or...
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 FreeTop 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
Top GitHub Comments
I think it’s reasonable to extend WCAG 1.4.13 to Snackbars i.e. add an affordance to dismiss Snackbar without moving mouse or keyboard cursor. Technically 1.4.13 generally doesn’t cover Snackbar since Snackbar can be shown via keyboard interaction (or any other interaction other than hover or focus). But since it’s visible content that’s not blocking the workflow, it should also not block the screen.
I’ve raised https://github.com/mui-org/material-ui/issues/22354 about focus / tab interactions after playing with it a bit more and scratching my head 🤔 😂