You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update "focusable element has no keyboard trap" examples to not use single key shortcuts (80af7b) (#1794)
* Made editorial update
* Updated examples to not use single key shortcut
* Update example descriptions
* Moved note to background
* Moved notes to background
* Update the descriptions of examples
* Improved readability of the examples
* Removed note from background
* Fixed typo
* Move scripts to test-assets
* Update focusable-no-keyboard-trap-80af7b.md
* Fix html
* Update _rules/focusable-no-keyboard-trap-80af7b.md
Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com>
* Update _rules/focusable-no-keyboard-trap-non-standard-nav-ebe86a.md
Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com>
Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com>
Copy file name to clipboardExpand all lines: _rules/focusable-no-keyboard-trap-80af7b.md
+39-73Lines changed: 39 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,7 @@ acknowledgments:
35
35
36
36
## Applicability
37
37
38
-
This rule only applies to any [HTML or SVG element][] that is [focusable][].
39
-
40
-
**Note:** This rule only applies to HTML and SVG. Thus, it is a partial check for WCAG 2.0 success criterion 2.1.2, which applies to all content.
38
+
This rule applies to any [HTML or SVG element][] that is [focusable][].
41
39
42
40
## Expectation
43
41
@@ -68,97 +66,79 @@ _There are no major accessibility support issues known for this rule._
68
66
69
67
#### Passed Example 1
70
68
71
-
No trap for keyboard navigation.
69
+
These [focusable][] elements do not create a trap for keyboard navigation.
72
70
73
71
```html
74
72
<ahref="#">Link 1</a> <button>Button1</button>
75
73
```
76
74
77
75
#### Passed Example 2
78
76
79
-
Using `tabindex="1"`.
77
+
This element is made [focusable][] by the `tabindex` attribute. It does not create a trap for keyboard navigation.
80
78
81
79
```html
82
80
<divtabindex="1">Text</div>
83
81
```
84
82
85
83
#### Passed Example 3
86
84
87
-
Using `tabindex="-1"`.
85
+
This element is made [focusable][] by the `tabindex` attribute, even if it is not part of the sequential focus navigation. It does not create a trap for keyboard navigation.
88
86
89
87
```html
90
88
<divtabindex="-1">Text</div>
91
89
```
92
90
93
91
#### Passed Example 4
94
92
95
-
Keyboard trap with help information in a paragraph before, and where the method advised works.
93
+
These focusable `button` elements have scripts that create a keyboard trap. The document includes help information in a paragraph before the `button` elements and the method advised works to escape the keyboard trap.
Keyboard trap with help information within the trap, and where the method advised works.
111
+
These focusable `button` elements have scripts that create a keyboard trap. The document includes help information within the trap and the method advised works to escape the keyboard trap.
Keyboard trap with "help" link that once clicked exposes the instructions.
129
+
These focusable `button` elements have scripts that create a keyboard trap. The document includes help information in a "help" link that once clicked exposes the instructions to escape the keyboard trap.
144
130
145
131
```html
146
-
<script>
147
-
var trapOn =false
148
-
149
-
functionshowHelpText() {
150
-
document.getElementById('helptext').innerHTML='<p>Press the M-key to Exit</p>'
0 commit comments