| id | 9au0ou | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | Focus returns to trigger | ||||||||||||||||||||
| rule_type | atomic | ||||||||||||||||||||
| description | This rule checks that when a modal closes the focus returns to the trigger that opened the modal. | ||||||||||||||||||||
| accessibility_requirements |
|
||||||||||||||||||||
| input_aspects |
|
||||||||||||||||||||
| acknowledgments |
|
This rule applies to any modal or item with the role of dialog + aria-modal="true" that when no longer visible, the focus returns to the instrument or trigger that made the modal visible.
On exiting the modal making it no longer visible, the assistive technology focus will return to the item in the owning document that was used to make the modal visible.
There are no assumptions.
There are no accessibility support issues known.
- Understanding Success Criterion 2.4.3: Focus Order
- G59: Placing the interactive elements in an order that follows sequences and relationships within the content
The button that is activated to display the modal gets the focus returned to it when the modal is dismissed using the close button in the modal.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example</title>
<script src="/test-assets/9au0ou/aria-apg-dialog.js"></script>
<script src="/test-assets/9au0ou/aria-apg-utils.js"></script>
<link href="/test-assets/9au0ou/aria-apg-dialog.css" rel="stylesheet" />
<link href="/test-assets/9au0ou/9au0ou.css" rel="stylesheet" />
</head>
<body>
<button type="button">Do nothing</button>
<button type="button" onclick="openDialog('dialog1', this)">Open modal dialog</button>
<button type="button">Do nothing</button>
<div id="dialog_layer" class="dialogs">
<div role="dialog" id="dialog1" aria-labelledby="dialog1_label" aria-modal="true"
class="hidden">
<h2 id="dialog1_label" class="dialog_label">Dialog title</h2>
<div class="dialog_form">Dialog content.</div>
<button type="button" class="close-button topright" aria-label="Close" title="Close"
onclick="closeDialog(this)">
×
</button>
<div style="text-align: right;">
<button type="button" onclick="closeDialog(this)">Ok</button>
<button type="button" onclick="closeDialog(this)">Cancel</button>
</div>
</div>
</div>
</body>
</html>The button that is activated to display the modal gets the focus returned to it when the modal is dismissed using the escape key.
Code needed!The button that is activated to display the modal gets the focus returned to it when the modal is dismissed using the cancel button.
Code needed!The link that is activated to display the modal gets the focus returned to it when the modal is dismissed using the close button in the modal.
Code needed!The link that is activated to display the modal gets the focus returned to it when the modal is dismissed using the escape key.
Code needed!The link that is activated to display the modal gets the focus returned to it when the modal is dismissed using the cancel button.
Code needed!The page has a list of buttons that is activated to display a modal, the focus is returned to the correct button on dismissing the modal.
Code needed!The button that is activated to display the modal gets the focus returned to the item after it when the modal is dismissed.
Code needed!The button that is activated to display the modal gets the focus returned to the start of the page when the modal is dismissed.
Code needed!The link that is activated to display the modal gets the focus returned to the item after it when the modal is dismissed.
Code needed!The link that is activated to display the modal gets the focus returned to the start of the page when the modal is dismissed.
Code needed!The page has a list of buttons that is activated to display a modal, the focus is returned to the incorrect button on dismissing the modal.
Code needed!TBC
Code needed!