Skip to content

Commit

Permalink
Dialog Pattern: Address @jnurthen review feedback in issue #325
Browse files Browse the repository at this point in the history
Modify the modal dialog design pattern section in aria-practices.html to:

1. Recommend tabindex of -1 when focusing static elements at the top of large dialogs.
2. Rephrase initial focus guidance for potentially destructive actions.
3. Add aria-modal to states and properties.
  • Loading branch information
mcking65 committed Mar 22, 2017
1 parent 0b49e3a commit ba0a447
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aria-practices.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,16 @@ <h4>Keyboard Interaction</h4>
<li>In all circumstances, focus moves to an element contained in the dialog.</li>
<li>Unless a condition where doing otherwise is advisable, focus is initially set on the first focusable element.</li>
<li>
If the content is large enough that focusing the first interactive element could cause the beginning of content to scroll out of view,
it is advisable to add <code>tabindex=<q>0</q></code> to a static element at the top of the dialog, such as the dialog title or first paragraph, and initially focus that element.
If content is large enough that focusing the first interactive element could cause the beginning of content to scroll out of view,
it is advisable to add <code>tabindex=<q>-1</q></code> to a static element at the top of the dialog, such as the dialog title or first paragraph, and initially focus that element.
</li>
<li>
If the dialog is asking the user to confirm a destructive action, it may be advisable to set focus on the least destructive action, especially if undoing the action is difficult or impossible.
If a dialog contains the final step in a process that is not easily reversible, such as deleting data or completing a financial transaction,
it may be advisable to set focus on the least destructive action, especially if undoing the action is difficult or impossible.
The <a href="#alertdialog">Alert Dialog Pattern</a> is often employed in such circumstances.
</li>
<li>
If the dialog is limited to interactions that either provide additional information or continue processing,
If a dialog is limited to interactions that either provide additional information or continue processing,
it might set focus to the element deemed to be most frequently desired, such as a <q>OK</q> or <q>Continue</q> button.
</li>
</ul>
Expand All @@ -554,6 +555,7 @@ <h4>Keyboard Interaction</h4>
<h4>WAI-ARIA Roles, States, and Properties</h4>
<ul>
<li>The element that serves as the dialog container has a role of <a href="#dialog" class="role-reference">dialog</a>.</li>
<li>The dialog container element has <a href="#aria-modal" class="property-reference">aria-modal</a> set to <code>true</code>.</li>
<li>The dialog has either:
<ul>
<li>The <a href="#aria-labelledby" class="property-reference">aria-labelledby</a> property set to refer to the visible dialog title.</li>
Expand Down

0 comments on commit ba0a447

Please sign in to comment.