Notifications / Alerts
- Live Regions
- Accessiblity Talks https://www.youtube.com/watch?v=W5YAaLLBKhQ&feature=youtu.be
- Live Region Codepen https://codepen.io/iankonlineada/pen/eYJwQBY
Aria Roles
- alert
- status
Poor support
- aria-atomic : what is read?
- aria-relevant : when it is read
- aria-busy : maybe don’t read this? Wait until something else is done. Dependent on screen reader / user tech.
No support
- role=“marquee”
- role=“timer”
HTML
Types of live regions
-
Dynamic search bar - Don’t want it to update to frequently. Should be ARIA-LIVE=“polite”
- Solution: create live region that reads off numer of results after user has stopped typing for a few seconds
-
Toasts - High risk of going wrong for many users – not just SR. Bad for zoom text users also.
- Toast should not time out / disappear unless there is an alternative way
-
Feed and chat messages - role=“log” plus aria-live=“assertive/polite” aria-atomic=“false” – create seperate live region that updates with new messages. Wrapping whole region makes SR read out whole region instead of new messages.
Adding live region to page
- Adding to DOM with role=“alert” is ok, doesn’t work well with other roles
- If updating, have the empty element in page, and push the updates into the region
- Create a notification center where user can check notifications – apps mostly
Resources
- Notification tests https://codepen.io/smhigley/pen/abOwGro