diff --git a/content/practices/keyboard-interface/keyboard-interface-practice.html b/content/practices/keyboard-interface/keyboard-interface-practice.html index 429dba46e0..3138808484 100644 --- a/content/practices/keyboard-interface/keyboard-interface-practice.html +++ b/content/practices/keyboard-interface/keyboard-interface-practice.html @@ -218,10 +218,10 @@
- The HTML tabindex
- and SVG2 tabindex
+ The HTML tabindex
+ and SVG2 tabindex
attributes can be used to add and remove elements from the tab sequence.
- The value of tabindex can also influence the order of the tab sequence, although authors are strongly advised not to use tabindex for that purpose.
+ The value of tabindex
can also influence the order of the tab sequence, although authors are strongly advised not to use tabindex
for that purpose.
@@ -236,23 +236,23 @@
The values of the tabindex attribute have the following effects.
+The values of the tabindex
attribute have the following effects.
tabindex
is not present or does not have a valid valuetabindex="0"
tabindex="-1"
tabindex="X"
where X
is an integer in the range 1 <= X <= 32767
tabindex
.
+ Elements with a tabindex
value of 0 and elements that are focusable by default will be in the sequence after elements with a tabindex
value of 1
or greater.
The following sections explain two strategies for managing focus inside composite elements: creating a roving tabindex and using the aria-activedescendant property.
+The following sections explain two strategies for managing focus inside composite elements: creating a roving tabindex
and using the aria-activedescendant
property.
tabindex
- When using roving tabindex to manage focus in a composite UI component, the element that is to be included in the tab sequence has tabindex of "0" and all other focusable elements contained in the composite have tabindex of "-1".
- The algorithm for the roving tabindex strategy is as follows.
+ When using roving tabindex
to manage focus in a composite UI component, the element that is to be included in the tab sequence has tabindex="0"
and all other focusable elements contained in the composite have tabindex="-1"
.
+ The algorithm for the roving tabindex
strategy is as follows.
One benefit of using roving tabindex rather than aria-activedescendant to manage focus is that the user agent will scroll the newly focused element into view.
+One benefit of using roving tabindex
rather than aria-activedescendant
to manage focus is that the user agent will scroll the newly focused element into view.
aria-activedescendant
- If a component container has an ARIA role that supports the aria-activedescendant property, it is not necessary to manipulate the tabindex attribute and move DOM focus among focusable elements within the container.
+ If a component container has an ARIA role that supports the aria-activedescendant property, it is not necessary to manipulate the tabindex
attribute and move DOM focus among focusable elements within the container.
Instead, only the container element needs to be included in the tab sequence.
- When the container has DOM focus, the value of aria-activedescendant on the container tells assistive technologies which element is active within the widget.
- Assistive technologies will consider the element referred to as active to be the focused element even though DOM focus is on the element that has the aria-activedescendant property.
- And, when the value of aria-activedescendant is changed, assistive technologies will receive focus change events equivalent to those received when DOM focus actually moves.
+ When the container has DOM focus, the value of aria-activedescendant
on the container tells assistive technologies which element is active within the widget.
+ Assistive technologies will consider the element referred to as active to be the focused element even though DOM focus is on the element that has the aria-activedescendant
property.
+ And, when the value of aria-activedescendant
is changed, assistive technologies will receive focus change events equivalent to those received when DOM focus actually moves.
The steps for using the aria-activedescendant method of managing focus are as follows.
+The steps for using the aria-activedescendant
method of managing focus are as follows.
aria-activedescendant
is loaded or created, ensure that:
tabindex
.aria-activedescendant="IDREF"
where IDREF is the ID of the element within the container that should be identified as active when the widget receives focus.
+ It has aria-activedescendant="IDREF"
where IDREF
is the id
of the element within the container that should be identified as active when the widget receives focus.
The referenced element needs to meet the DOM relationship requirements described below.
aria-activedescendant
on the container to refer to the element that should be reported to assistive technologies as active.aria-activedescendant
is referring to that target element when the container loses focus.
+ If it is not, set aria-activedescendant
to refer to the target element.
- The specification for aria-activedescendant places important restrictions on the DOM relationship between the focused element that has the aria-activedescendant attribute and the element referenced as active by the value of the attribute.
+ The specification for aria-activedescendant
places important restrictions on the DOM relationship between the focused element that has the aria-activedescendant
attribute and the element referenced as active by the value of the attribute.
One of the following three conditions must be met.
aria-activedescendant
and either:
This guidance focuses specifically on keyboard interaction. However, authors must of course also consider pointer interactions, such as mouse clicks
+ and touchscreen taps. When a component is clicked/tapped,
+ authors should take the same steps to set the correct tabindex
or aria-activedescendant
for the element,
+ in the same way that they would for keyboard navigation. Otherwise, this could lead to a confusing experience for users that switch between pointer
+ and keyboard navigation, as it will lead to a mismatch.