Skip to content

Commit 6c6d1d1

Browse files
committed
Add no-noniteractive-element-to-interactive-role rule in accessibility docs
1 parent bc1f449 commit 6c6d1d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

site/content/docs/06-accessibility-warnings.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ Some HTML elements have default ARIA roles. Giving these elements an ARIA role t
263263

264264
---
265265

266+
### `a11y-no-noninteractive-element-to-interactive-role`
267+
268+
[WAI-ARIA](https://www.w3.org/TR/wai-aria-1.1/#usage_intro) roles should not be used to convert a non-interactive element to an interactive element. Interactive ARIA roles include `button`, `link`, `checkbox`, `menuitem`, `menuitemcheckbox`, `menuitemradio`, `option`, `radio`, `searchbox`, `switch` and `textbox`.
269+
270+
```sv
271+
<!-- A11y: Non-interactive element <h3> cannot have interactive role 'searchbox' -->
272+
<h3 role="searchbox">Button</h3>
273+
```
274+
275+
---
276+
266277
### `a11y-no-noninteractive-tabindex`
267278

268279
Tab key navigation should be limited to elements on the page that can be interacted with.

0 commit comments

Comments
 (0)