Skip to content

Commit 3fe0f5b

Browse files
authored
feat: deprecate no-onchange rule (#854)
1 parent b809098 commit 3fe0f5b

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: docs/rules/no-onchange.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# no-onchange
22

3+
::: warning Deprecated
4+
This rule is based on reports of behavior of [old browsers (eg. IE 10 and below)](https://www.quirksmode.org/dom/events/change.html#t05). In the meantime, this behavior has been corrected, both in newer versions of browsers as well as [in the DOM spec](https://bugzilla.mozilla.org/show_bug.cgi?id=969068#c2).
5+
:::
6+
37
Enforce usage of `@blur` over/in parallel with `@change` on select menu elements for accessibility. `@blur` **should** be used instead of `@change`, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users. `@blur` is a more declarative action by the user: for instance in a dropdown, using the arrow keys to toggle between options will trigger the `@change` event in some browsers. Regardless, when a change of context results from an `@blur` event or an `@change` event, the user should be notified of the change unless it occurs below the currently focused element.
48

59
## 🔧 Options

Diff for: src/configs/recommended.ts

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const recommended: Linter.BaseConfig = {
2828
"vuejs-accessibility/no-access-key": "error",
2929
"vuejs-accessibility/no-autofocus": "error",
3030
"vuejs-accessibility/no-distracting-elements": "error",
31-
"vuejs-accessibility/no-onchange": "error",
3231
"vuejs-accessibility/no-redundant-roles": "error",
3332
"vuejs-accessibility/no-static-element-interactions": "error",
3433
"vuejs-accessibility/role-has-required-aria-props": "error",

Diff for: src/rules/no-onchange.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
const rule: Rule.RuleModule = {
1111
meta: {
1212
type: "problem",
13+
deprecated: true,
1314
docs: {
1415
url: makeDocsURL("no-onchange")
1516
},

0 commit comments

Comments
 (0)