Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between role=dialog and role=alertdialog?

According to the WAI-ARIA specification both roles should have:

  • Focus on first focusable element
  • User should not be able to leave dialog
  • Should have proper aria-label set
  • Should be used to interrupt flow and should require to take some action e.g. to click a button or to type something

The only difference I see is that alertdialog should have aria-describedby set.

This leads me to a question. Whats the practical difference between role=dialog and role=alertdialog? When shall we use one or another?

like image 329
karoluS Avatar asked Aug 01 '19 11:08

karoluS


People also ask

What's the difference between dialog and AlertDialog in Android?

AlertDialog is a lightweight version of a Dialog. This is supposed to deal with INFORMATIVE matters only, That's the reason why complex interactions with the user are limited. Dialog on the other hand is able to do even more complex things .

What does role dialog do?

The dialog role is used to mark up an HTML based application dialog or window that separates content or UI from the rest of the web application or page.

When to use AlertDialog?

Android AlertDialog can be used to display the dialog message with OK and Cancel buttons. It can be used to interrupt and ask the user about his/her choice to continue or discontinue. Android AlertDialog is composed of three regions: title, content area and action buttons.


1 Answers

As described here, alertdialog is a subtype of dialog.

What differentiate them is their role. As the name implies, alertdialogs should be used when the context requires the user's immediate attention (i.e in case of alerts, warnings or errors).

edit: corrected the explanation thanks to @cjl750 comment.

like image 163
Morphyish Avatar answered Oct 03 '22 15:10

Morphyish