Skip to content

Commit

Permalink
[Docs] aria-activedescendant-has-tabindex: align with changes from j…
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored and ljharb committed Feb 22, 2023
1 parent 64bfea6 commit 7b3492b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/rules/aria-activedescendant-has-tabindex.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ element will be applied as the value of `aria-activedescendant` on the input
element.

Because an element with `aria-activedescendant` must be tabbable, it must either
have an inherent `tabIndex` of zero or declare a `tabIndex` of zero with the `tabIndex`
attribute.
have an inherent `tabIndex` of zero or declare a `tabIndex` attribute.

## Rule details

Expand All @@ -34,16 +33,16 @@ This rule takes no arguments.
<div aria-activedescendant={someID} tabIndex={0} />
<div aria-activedescendant={someID} tabIndex="0" />
<div aria-activedescendant={someID} tabIndex={1} />
<div aria-activedescendant={someID} tabIndex={-1} />
<div aria-activedescendant={someID} tabIndex="-1" />
<input aria-activedescendant={someID} />
<input aria-activedescendant={someID} tabIndex={0} />
<input aria-activedescendant={someID} tabIndex={-1} />
```

### Fail
```jsx
<div aria-activedescendant={someID} />
<div aria-activedescendant={someID} tabIndex={-1} />
<div aria-activedescendant={someID} tabIndex="-1" />
<input aria-activedescendant={someID} tabIndex={-1} />
```

## Accessibility guidelines
Expand Down

0 comments on commit 7b3492b

Please sign in to comment.