Skip to content

Commit d79b788

Browse files
committed
[update] - Update docs for use-onblur-not-onchange (#32)
* [update] - Update docs for use-onblur-not-onchange In meantime of discussion on #31, just update the docs to explain motivation for lint rule. * [new] - Add total downloads badge Just for fun for me to see growth :)
1 parent 2eeb82e commit d79b788

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<a href='https://coveralls.io/github/evcohen/eslint-plugin-jsx-a11y?branch=master'>
1515
<img src='https://coveralls.io/repos/github/evcohen/eslint-plugin-jsx-a11y/badge.svg?branch=master' alt='Coverage Status' />
1616
</a>
17+
<a href='https://npmjs.org/package/eslint-plugin-jsx-a11y'>
18+
<img src='https://img.shields.io/npm/dt/eslint-plugin-jsx-a11y.svg?maxAge=2592000'
19+
alt='Total npm downloads' />
20+
</a>
1721
</p>
1822

1923
# eslint-plugin-jsx-a11y

docs/rules/use-onblur-not-onchange.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# use-onblur-not-onchange
22

3-
Enforce usage of onBlur over onChange for accessibility. onBlur must be used instead of onChange, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.
3+
Enforce usage of `onBlur` over/in parallel with `onChange` for accessibility. `onBlur` **should** be used instead of `onChange`, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users. `onBlur` is a more declarative action by the user: for instance in a dropdown, using the arrow keys to toggle between options will trigger the `onChange` event in some browsers. Regardless, when a change of context results from an `onBlur` event or an `onChange` event, the user should be notified of the change unless it occurs below the currently focused element.
4+
5+
#### References
6+
1. [onChange Event Accessibility Issues](http://cita.disability.uiuc.edu/html-best-practices/auto/onchange.php)
7+
2. [onChange Select Menu](http://www.themaninblue.com/writing/perspective/2004/10/19/)
48

59
## Rule details
610

@@ -15,4 +19,4 @@ This rule takes no arguments.
1519
### Fail
1620
```jsx
1721
<input onChange={updateModel} />
18-
```
22+
```

0 commit comments

Comments
 (0)