Skip to content

Use of WAI-ARIA attributes to create an accessible simulated alert dialog

Notifications You must be signed in to change notification settings

robmc/ARIA-Accessible-Alert-Dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a proof of concept using WAI-ARIA roles and properties to create an accessible alert dialog in a simulated modal dialog window.

This makes use of the ARIA alertdialog role and aria-labelledby property.

Important notes regarding the accessibility features of this demo:

  • When the dialog window is activated, programmatic focus not only moves to the dialog window to assist screen reader and other assistive technology users but also moves to the least critical element (the cancel button) to ensure that if the window were triggered accidentally there is minimal impact.
  • When the simulated modal dialog is open, the rest of the page is inactive and no elements in the DOM outside the dialog window can receive programmatic focus. Focus remains within the dialog window until it is closed.
  • A JavaScript event listener is included looking for the Escape key. Default behavior of modal dialog windows is that they can be closed by activating the Escape key so this is necessary to account for default functionality.
  • When the simulated dialog window is closed, programmatic focus returns to the element that triggered it. This is important as users navigating with screen readers will not lose their place on the page and have to navigate back to their previous location.

Additional notes/explanations are in the source code.

About

Use of WAI-ARIA attributes to create an accessible simulated alert dialog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published