Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6cfa84: Modify pass example 4 to be more realistic, using a dialog #1819

Merged
merged 19 commits into from Jun 16, 2022
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 32 additions & 2 deletions _rules/aria-hidden-no-focusable-content-6cfa84.md
Expand Up @@ -100,10 +100,21 @@ This `input` element is not [focusable][] because of the `disabled` attribute.
This `a` element is not [focusable][] because it moves focus to the `input` element whenever it receives focus.
tombrunet marked this conversation as resolved.
Show resolved Hide resolved

```html
<div id="sampleModal" role="dialog" aria-label="Sample Modal" aria-modal="true" style="border: solid black 1px; padding: 1rem;">
<label>Some input <input id="dialogFirst"></label><br />
<button id="closeButton">Close button</button>
tombrunet marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div aria-hidden="true">
<a href="/" style="position:absolute; top:-999em" onfocus="document.querySelector('input').focus()">First link</a>
<a href="#" id="sentinelAfter" style="position:absolute; top:-999em">Focus sentinel</a>
tombrunet marked this conversation as resolved.
Show resolved Hide resolved
</div>
<input />
<script>
document.getElementById("sentinelAfter").addEventListener("focus", () => {
document.getElementById("dialogFirst").focus();
});
document.getElementById("sampleModal").addEventListener("click", () => {
document.getElementById("sampleModal").style.display = "none";
});
tombrunet marked this conversation as resolved.
Show resolved Hide resolved
</script>
```

### Failed
Expand Down Expand Up @@ -169,6 +180,25 @@ This `summary` element is [focusable][].
</details>
```

#### Failed Example 7

This `a` element is [focusable][] because it fails to move focus when it receives focus. This is in contrast to Passed Example 4.
tombrunet marked this conversation as resolved.
Show resolved Hide resolved

```html
<div id="sampleModal" role="dialog" aria-label="Sample Modal" aria-modal="true" style="border: solid black 1px; padding: 1rem;">
<label>Some input <input id="dialogFirst"></label><br />
<button id="closeButton">Close button</button>
</div>
<div aria-hidden="true">
<a href="#" id="sentinelAfter" style="position:absolute; top:-999em">Focus sentinel</a>
</div>
<script>
document.getElementById("sampleModal").addEventListener("click", () => {
document.getElementById("sampleModal").style.display = "none";
});
</script>
```

### Inapplicable

#### Inapplicable Example 1
Expand Down