Skip to content

Commit

Permalink
Complete Draft of Dialog Pattern
Browse files Browse the repository at this point in the history
For issue #42, made the following changes to dialog_modal section of aria-practices.html:
1. Minor editorial revisions to the introduction for clarity.
2. Made reference to nonmodal dialogs a link to the nonmodal pattern.
3. Added notes providing guidance on initial focus placement.
4. Included a link to alert dialog pattern for circumstances where the dialog is confirming a destructive action.
5. Expanded guidance for focus placement after the dialog closes.
6. Added link to review issue 325 and removed link to development issue #42.
  • Loading branch information
mcking65 committed Mar 16, 2017
1 parent 5ca6a91 commit b59b3df
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions aria-practices.html
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,19 @@ <h3>Combo Box</h3>
<section class="widget" id="dialog_modal">
<h3>Dialog (Modal)</h3>
<p>
Work on this section is in progress. Provide feedback in
<a href="https://github.com/w3c/aria-practices/issues/42">issue 42.</a>
<strong>NOTE:</strong> This section has been significantly revised to address initial focus placement and other outstanding editorial issues.
Please provide feedback on this design pattern in
<a href="https://github.com/w3c/aria-practices/issues/325">issue 325.</a>
</p>
<p>
A <a href="#dialog" class="role-reference">dialog</a> is a window overlayed on either the primary window or another dialog window.
Like non-modal dialogs, modal dialogs have their own tab sequence, i.e., <kbd>Tab</kbd> and <kbd>Shift + Tab</kbd> do not move focus outside the dialog.
However, the window under a modal dialog is typically inert; users cannot interact with content outside the dialog window.
So, unlike non-modal dialogs, a modal dialog does not provide means for moving keyboard focus outside the dialog window without closing the dialog.
The window under a modal dialog is typically inert; users cannot interact with content outside the dialog window.
If the background window is not inert, then interaction with elements in the background window cause the modal window to close.
</p>
<p>
Like <a href="#dialog_nonmodal">non-modal dialogs</a>, modal dialogs contain their tab sequence.
That is, <kbd>Tab</kbd> and <kbd>Shift + Tab</kbd> do not move focus outside the dialog.
However, unlike most non-modal dialogs, modal dialogs do not provide means for moving keyboard focus outside the dialog window without closing the dialog.
</p>
<p>
The <a href="#alertdialog" class="role-reference">alertdialog</a> role is a special-case dialog role
Expand All @@ -520,12 +525,28 @@ <h4>Keyboard Interaction</h4>
<li><kbd>Escape</kbd>: Closes the dialog.</li>
</ul>
<ol class="note">
<li>
When a dialog opens, focus is typically set on the first focusable element.
<li> When a dialog opens, focus placement depends on the nature and size of the content.
<ul>
<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.
</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.
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,
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>
</li>
<li>
When a dialog closes, focus returns to the element that had focus before the dialog was invoked.
When a dialog closes, focus typically returns to the element that had focus before the dialog was invoked.
This is often the control that opened the dialog.
In circumstances where that element no longer exists, focus is set on an element that supports a logical work flow.
</li>
</ol>
</section>
Expand Down

0 comments on commit b59b3df

Please sign in to comment.