You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
Disallows the use of `autofocus` attribute on elements.
8
+
9
+
The `autofocus` attribute can cause usability issues for both sighted and non-sighted users by disrupting expected behavior and screen reader announcements.
10
+
11
+
## Examples
12
+
13
+
Examples of **incorrect** code for this rule:
14
+
15
+
```gjs
16
+
<template>
17
+
<input type="text" autofocus />
18
+
</template>
19
+
```
20
+
21
+
```gjs
22
+
<template>
23
+
<textarea autofocus></textarea>
24
+
</template>
25
+
```
26
+
27
+
Examples of **correct** code for this rule:
28
+
29
+
```gjs
30
+
<template>
31
+
<input type="text" />
32
+
</template>
33
+
```
34
+
35
+
```gjs
36
+
<template>
37
+
<textarea></textarea>
38
+
</template>
39
+
```
40
+
41
+
## When Not To Use It
42
+
43
+
If you need to autofocus for specific accessibility or UX requirements and have thoroughly tested with assistive technologies, you may disable this rule for those specific cases.
0 commit comments