-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a11y
no-noninteractive-element-interactions
(#8391)
- Loading branch information
1 parent
1728a89
commit 68bf3e8
Showing
10 changed files
with
146 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/validator/samples/a11y-no-noninteractive-element-interactions/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- VALID --> | ||
<div role="presentation" on:mouseup={() => {}} /> | ||
<div role="button" tabindex="-1" on:click={() => {}} on:keypress={() => {}} /> | ||
<div role="listitem" aria-hidden on:click={() => {}} on:keypress={() => {}} /> | ||
<button on:click={() => {}} /> | ||
<h1 contenteditable="true" on:keydown={() => {}}>Heading</h1> | ||
<h1>Heading</h1> | ||
|
||
<!-- INVALID --> | ||
<div role="listitem" on:mousedown={() => {}} /> | ||
<h1 on:click={() => {}} on:keydown={() => {}}>Heading</h1> | ||
<h1 role="banner" on:keyup={() => {}}>Heading</h1> | ||
<p on:keypress={() => {}} /> | ||
<div role="paragraph" on:mouseup={() => {}} /> |
62 changes: 62 additions & 0 deletions
62
test/validator/samples/a11y-no-noninteractive-element-interactions/warnings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[ | ||
{ | ||
"code": "a11y-no-noninteractive-element-interactions", | ||
"end": { | ||
"column": 47, | ||
"line": 10 | ||
}, | ||
"message": "A11y: Non-interactive element <div> should not be assigned mouse or keyboard event listeners.", | ||
"start": { | ||
"column": 0, | ||
"line": 10 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-no-noninteractive-element-interactions", | ||
"end": { | ||
"column": 58, | ||
"line": 11 | ||
}, | ||
"message": "A11y: Non-interactive element <h1> should not be assigned mouse or keyboard event listeners.", | ||
"start": { | ||
"column": 0, | ||
"line": 11 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-no-noninteractive-element-interactions", | ||
"end": { | ||
"column": 50, | ||
"line": 12 | ||
}, | ||
"message": "A11y: Non-interactive element <h1> should not be assigned mouse or keyboard event listeners.", | ||
"start": { | ||
"column": 0, | ||
"line": 12 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-no-noninteractive-element-interactions", | ||
"end": { | ||
"column": 28, | ||
"line": 13 | ||
}, | ||
"message": "A11y: Non-interactive element <p> should not be assigned mouse or keyboard event listeners.", | ||
"start": { | ||
"column": 0, | ||
"line": 13 | ||
} | ||
}, | ||
{ | ||
"code": "a11y-no-noninteractive-element-interactions", | ||
"end": { | ||
"column": 46, | ||
"line": 14 | ||
}, | ||
"message": "A11y: Non-interactive element <div> should not be assigned mouse or keyboard event listeners.", | ||
"start": { | ||
"column": 0, | ||
"line": 14 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters