mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-30 17:00:40 +01:00
[docs] add docs for a11y-no-redundant-roles (#7195)
This commit is contained in:
parent
e460acc8f1
commit
d1b3f462a5
@ -213,6 +213,20 @@ Enforce that `on:mouseover` and `on:mouseout` are accompanied by `on:focus` and
|
||||
|
||||
---
|
||||
|
||||
### `a11y-no-redundant-roles`
|
||||
|
||||
Some HTML elements have default ARIA roles. Giving these elements an ARIA role that is already set by the browser [has no effect](https://www.w3.org/TR/using-aria/#aria-does-nothing) and is redundant.
|
||||
|
||||
```sv
|
||||
<!-- A11y: Redundant role 'button' -->
|
||||
<button role="button" />
|
||||
|
||||
<!-- A11y: Redundant role 'img' -->
|
||||
<img role="img" src="foo.jpg" />
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `a11y-positive-tabindex`
|
||||
|
||||
Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users.
|
||||
|
Loading…
Reference in New Issue
Block a user