Dogfalo/materialize

toast screenreader accessibility

rober423 opened this issue · 1 comments

Expected Behavior

Toast message should be read by screenreader when they appear.

Readability is the first and most important thing for accessibility. See https://sheribyrnehaber.medium.com/designing-toast-messages-for-accessibility-fb610ac364be#bd14

Current Behavior

Currently Toast messages are not alerting the screenreader to the message having appeared, not allowing screenreader users to know what happened or what message was presented.

Possible Solution

add attribute role="alert" and aria-live="polite" to the toast container

container.setAttribute('id', 'toast-container');

Steps to Reproduce (for bugs)

  1. create a Materialize Toast
  2. run a screenreader
  3. trigger the toast to appear
  4. screenreader gives no indication anything happened

Context

I am trying to make my company's websites more accessible.

Your Environment

  • Version used: 0.99.0
  • Browser Name and version: Chrome v105.0.5195.125
  • Operating System and version (desktop or mobile): Windows 10
  • Link to your project (if appropriate):

Hi, this project is no longer maintained! The community-managed fork is still being maintained. Please open an issue there instead. Thanks! https://www.github.com/materializecss/materialize