According to the WAI-ARIA specification both roles should have:
aria-label
setThe 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?
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 .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With