Skip to content

Commit

Permalink
docs: update aria-activedescendant-has-tabindex.md
Browse files Browse the repository at this point in the history
align with changes from jsx-eslint#708
closes jsx-eslint#924
  • Loading branch information
dummdidumm committed Feb 22, 2023
1 parent 93f7885 commit bd285bb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/rules/aria-activedescendant-has-tabindex.md
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 bd285bb

Please sign in to comment.