-
Notifications
You must be signed in to change notification settings - Fork 78
"Focusable element has no keyboard trap via standard navigation" [a1b64e]: fix Failed example and add clarification #1905
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
Changes from all commits
949cf31
0f1be60
8c34b83
e02b8f3
ee68a93
ecc8a7c
53fba6e
e735807
e9ef6f7
04da2fc
3dd8177
5913004
29a1f91
37053bf
7b5c4b0
e2cd3ac
66d73e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ This rule applies to any [HTML or SVG element][] that is [focusable][]. | |
|
||
For each target element, focus can cycle to the browser UI by using [standard keyboard navigation](#standard-keyboard-navigation). | ||
|
||
**Note:** Cycling back to the browser UI can be done both by moving forward through the tab order and by moving backwards. It is not possible to fulfill this expectation by using browser specific shortcuts to return to the browser UI. | ||
**Note:** It is not possible to fulfill this expectation by using browser specific shortcuts to return to the browser UI. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not so sure that things that can only be exited with shift+tab should pass this SC. I think we need to get clarity on that. This note shouldn't have been a note. Knowing whether its backward, forward, or both needs to be in the expectation, but then by taking this out of the note without changing the expectation we're making the rule less clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Which is why we upgrade it to an Assumption 😁 The "one way is enough" view has been discussed on CG call on July 14th, check also the action point summary. Thus said, I do agree that our definition of "standard keyboard navigation" lists 6 keys (or combination) and the expectation is not fully clear whether one of these is enough (technically, it is because the def is "one or more of [these 6 keys]", so cycling back to UI using only one of the listed method does fulfil the definition). |
||
|
||
## Assumptions | ||
|
||
|
@@ -42,6 +42,8 @@ There are no accessibility support issues known. | |
|
||
## Background | ||
|
||
This rule only requires navigation in one direction (either forward or backward), not both, and not a specific one. It is clear that not being able to escape a focus trap in any direction is a failure of [Success Criterion 2.1.2 No keyboard trap][sc212]. However, it is less clear that being able to escape in only one direction is enough to satisfy it. If [Success Criterion 2.1.2 No keyboard trap][sc212] requires the possibility to escape the trap in a specific way (e.g. forward [standard keyboard navigation](#standard-keyboard-navigation)) or in both directions, this rule may pass while the criterion is not satisfied. | ||
|
||
### Bibliography | ||
|
||
- [Understanding Success Criterion 2.1.2: No Keyboard Trap](https://www.w3.org/WAI/WCAG21/Understanding/no-keyboard-trap.html) | ||
|
@@ -80,13 +82,14 @@ This element is made [focusable][] by the `tabindex` attribute, even if it is no | |
|
||
#### Failed Example 1 | ||
|
||
This [focusable][] element creates a keyboard trap bringing focus to the `button`. | ||
This [focusable][] element creates a keyboard trap bringing focus to the `button`. Note that if one of the links is removed, the focus may jump to the browser UI before the timeout expires, at which point the `this.focus()` trap cannot trigger anymore. | ||
|
||
```html | ||
<a href="#">Link 1</a> | ||
<button onblur="setTimeout(() => this.focus(), 10)"> | ||
Button1 | ||
</button> | ||
<a href="#">Link 2</a> | ||
``` | ||
|
||
#### Failed Example 2 | ||
|
@@ -151,3 +154,4 @@ There is no [focusable][] element. | |
|
||
[focusable]: #focusable 'Definition of focusable' | ||
[html or svg element]: #namespaced-element | ||
[sc212]: https://www.w3.org/TR/WCAG21/#no-keyboard-trap 'Success Criterion 2.1.2 No Keyboard Trap' |
Uh oh!
There was an error while loading. Please reload this page.