WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Semi-inert modals

for

From: Bryan Garaventa
Date: Mar 31, 2022 5:02PM


"Do you have to make it known to screen readers that the focus order is changed because of the activated element? Or does the dialog role handle that already?"

A dialog is simply a common widget type that non-sighted screen reader users are used to, so there is no need to notify users that the tab order has changed. When a dialog opens on the desktop and focus is set into it, it is expected that focus will remain in that dialog unless you activate a control or press Escape to close it. Any keyboard hints that are announced when the dialog opens are provided by the screen reader to assist navigation, but none of these should be hardcoded in the markup for the dialog, otherwise it will confuse users of differing device types such as mobile touch devices when they hear keyboard instructions that have no relevance in that environment. A datepicker is a complex widget type though, so it may be reasonable to provide some instruction when activating a help icon or some other mechanism. It just depends how complicated the controls are to operate it.

If the dialog is large enough to cover the majority of the content, it probably would be a good idea to make this modal, especially if there is no specific reason for it not to be such as providing an outside toggle or related controls that a user would expect to retain access to while it is open.

Whichever way you go, it is important to always ensure you can easily close the dialog from the keyboard or by activating a control for that purpose where a keyboard is not present. Many times I've encountered dialogs that assume keyboard access that could not actually be closed by touch on mobile devices because there was no mechanism provided for doing this when aria-modal was set to 'true' on a dialog role.

Hopefully this helps a bit.

All the best,
Bryan


Bryan Garaventa
Principal Accessibility Architect
Level Access, Inc.
<EMAIL REMOVED>
415.624.2709 (o)
www.LevelAccess.com