-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: silence a11y attribute warnings when spread attributes present (#…
- Loading branch information
1 parent
f5406c9
commit b8607f8
Showing
5 changed files
with
36 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: silence a11y attribute warnings when spread attributes present |
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
18 changes: 8 additions & 10 deletions
18
packages/svelte/tests/validator/samples/a11y-mouse-events-have-key-events/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 |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<script> | ||
// Even if otherProps contains onBlur and/or onFocus, the rule will still fail. | ||
// Props should be passed down explicitly for rule to pass. | ||
const otherProps = { | ||
onBlur: () => void 0, | ||
onFocus: () => void 0 | ||
onblur: () => {}, | ||
onfocus: () => {} | ||
}; | ||
</script> | ||
|
||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseover={() => void 0}></div> | ||
<div onmouseover={() => {}}></div> | ||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseover={() => void 0} on:focus={() => void 0}></div> | ||
<div onmouseover={() => {}} onfocus={() => {}}></div> | ||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseover={() => void 0} {...otherProps}></div> | ||
<div onmouseover={() => {}} {...otherProps}></div> | ||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseout={() => void 0}></div> | ||
<div onmouseout={() => {}}></div> | ||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseout={() => void 0} on:blur={() => void 0}></div> | ||
<div onmouseout={() => {}} onblur={() => {}}></div> | ||
<!-- svelte-ignore a11y_no_static_element_interactions --> | ||
<div on:mouseout={() => void 0} {...otherProps}></div> | ||
<div onmouseout={() => {}} {...otherProps}></div> |
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