Skip to content

Commit f43e0c7

Browse files
committed
[chore]: revert md format changes
1 parent d1fa087 commit f43e0c7

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

docs/rules/no-static-element-interactions.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@ Indicate the element's role with the `role` attribute:
2121
onClick={onClickHandler}
2222
onKeyPress={onKeyPressHandler}
2323
role="button"
24-
tabindex="0"
25-
>
24+
tabindex="0">
2625
Save
2726
</div>
2827
```
2928

3029
Common interactive roles include:
3130

32-
1. `button`
33-
1. `link`
34-
1. `checkbox`
35-
1. `menuitem`
36-
1. `menuitemcheckbox`
37-
1. `menuitemradio`
38-
1. `option`
39-
1. `radio`
40-
1. `searchbox`
41-
1. `switch`
42-
1. `textbox`
31+
1. `button`
32+
1. `link`
33+
1. `checkbox`
34+
1. `menuitem`
35+
1. `menuitemcheckbox`
36+
1. `menuitemradio`
37+
1. `option`
38+
1. `radio`
39+
1. `searchbox`
40+
1. `switch`
41+
1. `textbox`
4342

4443
Note: Adding a role to your element does **not** add behavior. When a semantic HTML element like `<button>` is used, then it will also respond to Enter key presses when it has focus. The developer is responsible for providing the expected behavior of an element that the role suggests it would have: focusability and key press support.
4544

@@ -48,16 +47,12 @@ Note: Adding a role to your element does **not** add behavior. When a semantic H
4847
If your element is catching bubbled click or key events from descendant elements, there are no appropriate roles for your element: you will have to deactivate the rule. Consider explaining the reason for disabling the rule as well.
4948

5049
```jsx
51-
{
52-
/* The <div> element has a child <button> element that allows keyboard interaction */
53-
}
54-
{
55-
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
56-
}
50+
{/* The <div> element has a child <button> element that allows keyboard interaction */}
51+
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
5752
<div onClick={this.handleButtonClick}>
5853
<button>Save</button>
5954
<button>Cancel</button>
60-
</div>;
55+
</div>
6156
```
6257

6358
Do not use the role `presentation` on the element: it removes the element's semantics, and may also remove its children's semantics, creating big issues with assistive technology.

0 commit comments

Comments
 (0)