Open ZoeBijl opened 4 years ago
Bit more of a rabbit hole than I thought…
OK, so alert role in ARIA editor’s draft says:
Since alerts are not required to receive focus, authors SHOULD NOT require users to close an alert. If an author desires focus to move to a message when it is conveyed, the author SHOULD use
alertdialog
instead ofalert
.
Which makes sense. That raises two questions tho:
First, if the close button is in addition to an automatic closing system, should alertdialog
still be used over alert
?
Second, the alert dialog design pattern itself doesn’t mention underlying content being inert. But in its “Keyboard interaction” section it links to that of the modal dialog pattern. Which states in the bullet about the Tab key that:
If focus is on the last tabbable element inside the dialog, moves focus to the first tabbable element inside the dialog.
The same applies for Shift + Tab. Does that then mean that an alertdialog
should always be treated as a modal dialog?
There are plenty of places where alertdialogs aren’t like modal dialogs at all. Not in that other content is inert anyway. Notifications in both macOS and Windows are an example of that. Would it make sense to exclude the inertness of the underlying content, and the keyboard traptness, as requirements for alertdialogs in those cases?
The alert design pattern’s Roles, States, and Properties section states:
That’s it. And that’s fine in most cases. But when a button is added to the alert things get a bit wonky. Sometimes close buttons are added to alerts so you can dismiss them. Now your code might look like this:
And the alert would be announced as
. Which would be a bit weird.It might be better to follow the rules for
alertdialog
in those cases. Which would lead to code that looks something like this:…or perhaps more accurately:
Could we include the following prose to the Roles sections?