mirror of https://github.com/sveltejs/svelte
parent
8238ac46dc
commit
4578d242f8
@ -0,0 +1,16 @@
|
||||
<script>
|
||||
const handleKeyDown = ()=>{}
|
||||
const handleKeyUp = ()=>{}
|
||||
const handleKeyPress = ()=>{}
|
||||
</script>
|
||||
|
||||
<!-- succeed -->
|
||||
<div onClick={() => {}} onKeyDown={handleKeyDown} />
|
||||
<div onClick={() => {}} onKeyUp={handleKeyUp} />
|
||||
<div onClick={() => {}} onKeyPress={handleKeyPress} />
|
||||
<button onClick={() => {}} />
|
||||
<div onClick{() => {}} aria-hidden="true" />
|
||||
|
||||
<!-- fail -->
|
||||
<div onClick={() => {}} />
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"code": "a11y-click-events-have-key-events",
|
||||
"message": "A11y: elements with onClick property should have a keyboard key handler such as onKeyPress , onKeyDown or onKeyUp.",
|
||||
"start": {
|
||||
"line": 15,
|
||||
"column": 6,
|
||||
"character": 417
|
||||
},
|
||||
"end": {
|
||||
"line": 15,
|
||||
"column": 24,
|
||||
"character": 435
|
||||
},
|
||||
"pos": 417
|
||||
}
|
||||
]
|
||||
Loading…
Reference in new issue