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 @@

Keyboard Navigation Between Components (The Tab Sequence)

- 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 @@

Keyboard Navigation Between Components (The Tab Sequence)

The most robust method of manipulating the order of the tab sequence while also maintaining alignment with the reading order that is currently available in all browsers is rearranging elements in the DOM.

-

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 value
+
tabindex is not present or does not have a valid value
The element has its default focus behavior. In HTML, only form controls and anchors with an HREF attribute are included in the tab sequence.
-
tabindex="0"
+
tabindex="0"
The element is included in the tab sequence based on its position in the DOM.
-
tabindex="-1"
+
tabindex="-1"
The element is not included in the tab sequence but is focusable with element.focus().
-
tabindex="X" where X is an integer in the range 1 <= X <= 32767
+
tabindex="X" where X is an integer in the range 1 <= X <= 32767
Authors are strongly advised NOT to use these values. - The element is placed in the tab sequence based on the value of 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 element is placed in the tab sequence based on the value of 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.
@@ -291,14 +291,14 @@

Keyboard Navigation Inside Components

-

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.

-

Managing Focus Within Components Using a Roving tabindex

+

Managing Focus Within Components Using a Roving 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.

-

Managing Focus in Composites Using aria-activedescendant

+

Managing Focus in Composites Using 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.

- 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.

  1. The element referenced as active is a DOM descendant of the focused referencing element.
  2. The focused referencing element has a value specified for the aria-owns property that includes the ID of the element referenced as active.
  3. - The focused referencing element has role of combobox, textbox, or searchbox and has aria-controls property referring to an element with a role that supports aria-activedescendant and either: + The focused referencing element has role of combobox, textbox, or searchbox and has aria-controls property referring to an element with a role that supports aria-activedescendant and either:
    1. The element referenced as active is a descendant of the controlled element.
    2. The controlled element has a value specified for the aria-owns property that includes the ID of the element referenced as active.
    3. @@ -376,6 +376,16 @@

      Managing Focus in Composites Using aria-activedescendant

+ +
+

Note

+

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.

+
+