Skip to content

Commit

Permalink
Modal Dialog Pattern: Revise Note About Focus After Close
Browse files Browse the repository at this point in the history
For issue #325, rewrite note 2 in the keyboard section that explains where  focus should go after the dialog closes.
This revised version includes an example of a scenario where moving focus away from the invoking element is appropriate.
  • Loading branch information
mcking65 committed May 21, 2017
1 parent 343c691 commit 9ae09df
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions aria-practices.html
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,19 @@ <h4>Keyboard Interaction</h4>
</ul>
</li>
<li>
When a dialog closes, focus is set on an element that supports a logical work flow.
If the element that had focus before the dialog was invoked still exists, that element is usually the most appropriate choice.
When a dialog closes, focus returns to the element that invoked the dialog unless either:
<ul>
<li>The invoking element no longer exists. Then, focus is set on another element that provides logical work flow.</li>
<li>The work flow design includes the following conditions that can occasionally make focusing a different element a more logical choice:
<ol>
<li>It is very unlikely users need to immediately re-invoke the dialog.</li>
<li>The task completed in the dialog is directly related to a subsequent step in the work flow.</li>
</ol>
For example, a grid has an associated toolbar with a button for adding rows.
the Add Rows button opens a dialog that prompts for the number of rows.
After the dialog closes, focus is placed in the first cell of the first new row.
</li>
</ul>
</li>
<li>It is strongly recommended that the tab sequence of all dialogs include a visible element with role <code>button</code> that closes the dialog, such as a close icon or cancel button.</li>
</ol>
Expand Down

0 comments on commit 9ae09df

Please sign in to comment.